Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

automatic-semicolon-insertion

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

automatic-semicolon-insertion - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

src/index.js

37

package.json
{
"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 @@ /*

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc