automatic-semicolon-insertion

2018-12-07 admin

automatic-semicolon-insertion是什么

什么是automatic-semicolon-insertion,Insert missing semicolons, remove unneeded ones.

automatic-semicolon-insertion使用教程帮助文档

automatic-semicolon-insertion Build Status

Insert missing semicolons, remove unneeded ones.

Install

$ yarn add automatic-semicolon-insertion
# or via npm
$ npm install automatic-semicolon-insertion

Usage

import asi from 'automatic-semicolon-insertion';
import { parse } from '@babel/parser';

const source = 'let a = class {}'; // should have a semicolon after it

console.log(asi(source, parse(source)));

/*
prints:

{ insertions: [ { index: 16, content: ';' } ], removals: [] }
*/

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47539.html

文章标题:automatic-semicolon-insertion

回到顶部