@putout/eslint
Advanced tools
Comparing version
@@ -117,2 +117,3 @@ 'use strict'; | ||
}; | ||
module.exports.createGetSpaceBeforeNode = createGetSpacesBeforeNode; | ||
@@ -129,2 +130,2 @@ const createGetSpacesAfterNode = ({getText}) => (node, {text = getText(node)}) => { | ||
}; | ||
module.exports.createGetSpacesAfterNode = createGetSpacesAfterNode; |
{ | ||
"name": "@putout/eslint", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"type": "commonjs", | ||
@@ -15,3 +15,4 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
".": "./lib/eslint.js", | ||
"./create-plugin": "./lib/create-plugin/index.js" | ||
"./create-plugin": "./lib/create-plugin/index.js", | ||
"./lint": "./lib/lint/index.js" | ||
}, | ||
@@ -18,0 +19,0 @@ "repository": { |
@@ -37,3 +37,3 @@ # @putout/eslint [![NPM version][NPMIMGURL]][NPMURL] | ||
- ☝️ *[🐊**Putout** returns object with `code` and `places` properties](https://github.com/coderaiser/putout#plugins).* | ||
- ☝️ * **ESLint** has a `name` property that is used to calculate configuration file. * | ||
- ☝️ ***ESLint** has a `name` property that is used to calculate configuration file.* | ||
@@ -139,8 +139,22 @@ And you can even override any of **ESLint** ⚙️ options with help of `config` property: | ||
module.exports.rules = { | ||
'remove-duplicate-extensions': createPlugin('remove-duplicate-extensions'), | ||
'remove-duplicate-extensions': createPlugin(require('./remove-duplicate-extensions')), | ||
}; | ||
``` | ||
### `lint(code, {fix, plugins})` | ||
```js | ||
const lint = require('@putout/eslint/lint'); | ||
const removeDebugger = require('./remove-debugger'); | ||
const [code, places] = lint('debugger', { | ||
fix: true, // default | ||
plugins: [ | ||
['remove-debugger', createPlugin(removeDebugger)], | ||
], | ||
}); | ||
``` | ||
## License | ||
MIT |
14458
9.53%8
14.29%256
12.78%159
9.66%