eslint-plugin-putout
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "eslint-plugin-putout", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "eslint plagin for putout", | ||
"release": false, | ||
"tag": false, | ||
"changelog": false, | ||
"repository": { | ||
@@ -26,3 +29,3 @@ "type": "git", | ||
"@putout/eslint-config": "^1.2.0" | ||
}, | ||
}, | ||
"devDependencies": { | ||
@@ -42,3 +45,6 @@ "eslint": "^5.0.0", | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
# eslint-plugin-putout | ||
eslint plagin for putout | ||
[ESLint](https://eslint.org) plagin for putout. | ||
## Installation | ||
You'll first need to install [ESLint](http://eslint.org): | ||
``` | ||
$ npm i eslint --save-dev | ||
$ npm i eslint eslint-plugin-putout -D | ||
``` | ||
Next, install `eslint-plugin-putout`: | ||
``` | ||
$ npm install eslint-plugin-putout --save-dev | ||
``` | ||
**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-putout` globally. | ||
@@ -27,2 +19,5 @@ | ||
{ | ||
"extends": [ | ||
"plugin:putout/recommended", | ||
], | ||
"plugins": [ | ||
@@ -34,3 +29,2 @@ "putout" | ||
Then configure the rules you want to use under the rules section. | ||
@@ -41,3 +35,3 @@ | ||
"rules": { | ||
"putout/rule-name": 2 | ||
"putout/one-line-destructuring": "error" | ||
} | ||
@@ -49,7 +43,3 @@ } | ||
* Fill in provided rules here | ||
- [One line destructuring](docs/rules/one-line-destructuring.md) | ||
@@ -31,5 +31,5 @@ /** | ||
.getSourceCode() | ||
.getText(node); | ||
.getText(node.parent); | ||
if (!text.includes('{\n')) | ||
if (!/(const|let|var) \{\n/.test(text)) | ||
return; | ||
@@ -36,0 +36,0 @@ |
14692
6
42