automatic-semicolon-insertion
Advanced tools
Comparing version 1.0.2 to 2.0.0
{ | ||
"name": "automatic-semicolon-insertion", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"description": "Insert missing semicolons, remove unneeded ones.", | ||
"main": "dist/automatic-semicolon-insertion.js", | ||
"jsnext:main": "dist/automatic-semicolon-insertion.m.js", | ||
"main": "src/index.js", | ||
"directories": { | ||
@@ -11,5 +10,6 @@ "test": "test" | ||
"scripts": { | ||
"build": "rollup -c rollup.es.config.js && rollup -c rollup.umd.config.js", | ||
"test": "mocha --compilers js:babel-register", | ||
"prepublish": "npm run build" | ||
"build": "tsc --project .", | ||
"pretest": "yarn build", | ||
"test": "mocha", | ||
"prepare": "yarn build" | ||
}, | ||
@@ -21,3 +21,3 @@ "repository": { | ||
"files": [ | ||
"dist" | ||
"src/**/*.js" | ||
], | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
], | ||
"author": "Brian Donovan <me@brian-donovan.com>", | ||
"author": "Brian Donovan", | ||
"license": "MIT", | ||
@@ -36,14 +36,13 @@ "bugs": { | ||
"homepage": "https://github.com/eventualbuddha/automatic-semicolon-insertion#readme", | ||
"dependencies": { | ||
"@babel/traverse": "^7.1.6", | ||
"@babel/types": "^7.1.6" | ||
}, | ||
"devDependencies": { | ||
"ast-processor-babylon-config": "^1.0.0", | ||
"babel-plugin-syntax-flow": "^6.8.0", | ||
"babel-plugin-transform-flow-strip-types": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-es2015-rollup": "^1.1.1", | ||
"babel-register": "^6.9.0", | ||
"babelrc-rollup": "^1.0.0", | ||
"babylon": "^6.8.0", | ||
"mocha": "^2.5.3", | ||
"rollup": "^0.26.3", | ||
"rollup-plugin-babel": "^2.4.0" | ||
"@babel/parser": "^7.1.6", | ||
"@types/babel__traverse": "^7.0.1", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.10", | ||
"mocha": "^5.2.0", | ||
"typescript": "^3.1.6" | ||
}, | ||
@@ -50,0 +49,0 @@ "publishConfig": { |
@@ -1,2 +0,2 @@ | ||
# automatic-semicolon-insertion [![Build Status](https://travis-ci.org/decaffeinate/coffee-lex.svg?branch=master)](https://travis-ci.org/decaffeinate/coffee-lex) | ||
# automatic-semicolon-insertion [![Build Status](https://travis-ci.org/eventualbuddha/automatic-semicolon-insertion.svg?branch=master)](https://travis-ci.org/eventualbuddha/automatic-semicolon-insertion) | ||
@@ -7,10 +7,8 @@ Insert missing semicolons, remove unneeded ones. | ||
```sh | ||
$ yarn add automatic-semicolon-insertion | ||
# or via npm | ||
$ npm install automatic-semicolon-insertion | ||
``` | ||
$ npm install [--save] automatic-semicolon-insertion | ||
``` | ||
If you're using an AST from babel (babylon) you can also install | ||
`ast-processor-babylon-config` to make it easier. Otherwise you'll have | ||
to implement the expected methods yourself. | ||
## Usage | ||
@@ -20,12 +18,7 @@ | ||
import asi from 'automatic-semicolon-insertion'; | ||
import buildConfig from 'ast-processor-babylon-config'; | ||
import { parse } from 'babylon'; | ||
import { parse } from '@babel/parser'; | ||
let source = 'let a = class {}'; // should have a semicolon after it | ||
let ast = parse(source); | ||
let config = buildConfig(source, ast); | ||
const source = 'let a = class {}'; // should have a semicolon after it | ||
asi(config); | ||
let { insertions, removals } = config; | ||
console.log({ insertions, removals }); | ||
console.log(asi(source, parse(source))); | ||
@@ -32,0 +25,0 @@ /* |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
7819
2
4
153
29
1
+ Added@babel/traverse@^7.1.6
+ Added@babel/types@^7.1.6
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/generator@7.26.3(transitive)
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.3(transitive)
+ Added@babel/template@7.25.9(transitive)
+ Added@babel/traverse@7.26.4(transitive)
+ Added@babel/types@7.26.3(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@3.1.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedpicocolors@1.1.1(transitive)