Find and fix problems in your JavaScript code
(c) eslint.org
🐊Putout plugin helps to automate fixing ESLint config.
npm i @putout/plugin-eslint -D
{
"rules": {
"eslint/add-putout": "on",
"eslint/apply-safe-align": "on",
"eslint/move-putout-to-end-of-extends": "on",
"eslint/convert-ide-to-safe": "on",
"eslint/convert-require-to-import": "on",
"eslint/convert-node-to-n": "on",
"eslint/remove-no-missing": "on",
"eslint/remove-no-unpublished-require": "on",
"eslint/remove-no-unsupported-features": "on",
"eslint/remove-overrides-with-empty-rules": "on"
}
}
{
"extends": [
+ "plugin:putout/safe+align",
"plugin:node/recommended"
],
"plugins": [
+ "putout",
"node"
]
}
{
- "rules": {
- "putout/align-spaces": "error"
- },
"extends": [
- "plugin:putout/safe",
+ "plugin:putout/safe+align",
"plugin:node/recommended"
],
"plugins": [
"putout",
"node"
]
}
{
"extends": [
"plugin:putout/recommended",
"plugin:node/recommended"
],
"plugins": [
"putout",
"node"
]
}
{
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
}
{
"extends": [
"plugin:node/recommended",
"plugin:putout/ide"
],
"plugins": [
"putout",
"node"
]
}
{
"extends": [
"plugin:node/recommended",
"plugin:putout/safe"
],
"plugins": [
"putout",
"node"
]
}
node/no-missing-require
has no sense when type=module
in package.json
.
Check it out in 🐊Putout Editor.
{
"overrides": [{
"files": "test/*.js",
"rules": {
- "node/no-missing-require": "off"
+ "node/no-missing-import": "off"
}
}],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
node/remove-no-unpublished-require
should be enabled, since this is a very useful rule, which shows what files should be add to .npmignore
.
{
"overrides": [{
"files": "test/*.js",
"rules": {
- "node/no-unpublished-require": "off"
}
}],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
node/remove-no-unsupported-features
is already disabled in eslint-plugin-putout.
{
"overrides": [{
"files": "test/*.js",
"rules": {
- "node/no-unpublished-require": "off"
}
}],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
overrides
with rules: {}
has no sense. Check out in 🐊[Putout Editor]:
Remove overrides
with one element with empty rules
:
{
- "overrides": [{
- "files": "test/*.js",
- "rules": {
- }
- }],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
Or remove empty overrides
:
{
- "overrides": [],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
And ofcourse remove only elements with empty rules
:
{
"overrides": [{
- "files": "test/*.js",
- "rules": {
- }
- }, {
"files": "test/*.js",
"rules": {
"no-semi": "off"
}
}],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
eslint-plugin-node
is no longer supported. Better to use eslint-plugin-n
.
{
"extends": [
"plugin:putout/safe+align",
- "plugin:node/recommended"
+ "plugin:n/recommended"
],
"plugins": [
"putout",
- "node"
+ "n"
]
}
node/remove-no-missing-require
and node/remove-no-missing-import
doesn't supports exports
and already disabled by eslint-plugin-putout
.
{
"overrides": [{
"files": "test/*.js",
"rules": {
- "node/no-missing-require": "off",
- "node/no-missing-import": "off"
}
}],
"extends": [
"plugin:node/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
]
};
MIT