Gathering detailed insights and metrics for @putout/plugin-eslint
Gathering detailed insights and metrics for @putout/plugin-eslint
Gathering detailed insights and metrics for @putout/plugin-eslint
Gathering detailed insights and metrics for @putout/plugin-eslint
putout
🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json
eslint-plugin-putout
ESLint plugin for 🐊Putout
@putout/plugin-eslint-plugin
🐊Putout plugin for eslint config
@2chevskii/eslint-plugin-putout
Modified eslint-plugin-putout
🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
npm install @putout/plugin-eslint
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (99%)
TypeScript (0.62%)
WebAssembly (0.19%)
HTML (0.16%)
CSS (0.02%)
Svelte (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
757 Stars
16,378 Commits
43 Forks
9 Watchers
46 Branches
24 Contributors
Updated on Jul 12, 2025
Latest Version
14.0.1
Package Id
@putout/plugin-eslint@14.0.1
Unpacked Size
50.53 kB
Size
11.58 kB
File Count
36
NPM Version
11.1.0
Node Version
22.14.0
Published on
Apr 24, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
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
1{ 2 "rules": { 3 "eslint/add-putout": "on", 4 "eslint/apply-define-config": "on", 5 "eslint/apply-dir-to-flat": "on", 6 "eslint/apply-create-eslint": "on", 7 "eslint/apply-ignores": ["off", { 8 "ignores": ["**/fixture"] 9 }], 10 "eslint/apply-safe-align": "on", 11 "eslint/apply-match-to-flat": "on", 12 "eslint/declare": "on", 13 "eslint/move-putout-to-end-of-extends": "on", 14 "eslint/convert-export-match-to-decleration": "on", 15 "eslint/convert-files-to-array": "on", 16 "eslint/convert-ide-to-safe": "on", 17 "eslint/convert-require-to-import": "on", 18 "eslint/convert-node-to-n": "on", 19 "eslint/convert-plugins-array-to-object": "on", 20 "eslint/convert-rc-to-flat": "off", 21 "eslint/remove-no-missing": "on", 22 "eslint/remove-no-unpublished-require": "on", 23 "eslint/remove-no-unsupported-features": "on", 24 "eslint/remove-overrides-with-empty-rules": "on", 25 "eslint/remove-useless-slice": "on", 26 "eslint/remove-useless-define-config": "on", 27 "eslint/remove-useless-properties": "on", 28 "eslint/remove-useless-match-to-flat": "on", 29 "eslint/remove-parser-options": "on", 30 "eslint/remove-suffix-config": "on", 31 "eslint/remove-create-eslint-config-with-one-argument": "on", 32 "eslint/remove-spread-from-create-eslint-config": "on" 33 } 34}
1{ 2 "extends": [ 3+ "plugin:putout/safe+align", 4 "plugin:node/recommended" 5 ], 6 "plugins": [ 7+ "putout", 8 "node" 9 ] 10}
Checkout in 🐊Putout Editor.
1import {safeAlign} from 'eslint-plugin-putout'; 2import {createESLintConfig} from '@putout/eslint-flat'; 3 4export default createESLintConfig([ 5 safeAlign, { 6 ignores: ['**/fixture'], 7 }, 8]);
1import {safeAlign} from 'eslint-plugin-putout'; 2import {defineConfig} from '@eslint/config'; 3 4export default defineConfig([ 5 safeAlign, { 6 ignores: ['**/fixture'], 7 }, 8]);
Checkout in 🐊Putout Editor. Legacy config:
1{ 2 "extends": [ 3 "plugin:putout/safe+align", 4 "plugin:node/recommended" 5 ], 6 "plugins": [ 7 "putout", 8 "node" 9 ], 10 "ignorePatterns": [ 11 "**/fixture" 12 ] 13}
Flat config:
1-export default safeAlign; 2+export default [ 3+ ...safeAlign, { 4+ ignores: [ 5+ "**/fixture" 6+ ] 7+}];
Checkout in 🐊Putout Editor.
1export default [ 2 ...safeAlign, { 3 ignores: ['**/fixture'], 4 }, 5];
1export default createESLintConfig([ 2 safeAlign, { 3 ignores: ['**/fixture'], 4 }, 5]);
1{ 2- "rules": { 3- "putout/align-spaces": "error" 4- }, 5 "extends": [ 6- "plugin:putout/safe", 7+ "plugin:putout/safe+align", 8 "plugin:node/recommended" 9 ], 10 "plugins": [ 11 "putout", 12 "node" 13 ] 14}
matchToFlatDir()
and mergeESLintConfigs
supports __dirname
or import.meta.url
starting from v2
of @putout/eslint-flat
.
Check out in 🐊Putout Editor.
1const scriptsConfig = await matchToFlatDir('scripts'); 2const monoConfig = await mergeESLintConfigs(['codemods', 'packages', 'rules']); 3 4module.exports = [ 5 ...scriptsConfig, 6 ...monoConfig, 7];
1// CommonJS
2const scriptsConfig = await matchToFlatDir(__dirname, 'scripts');
3
4// ESM
5const monoConfig = await mergeESLintConfigs(import.meta.url, ['codemods', 'packages', 'rules']);
6
7module.exports = [
8 ...scriptsConfig,
9 ...monoConfig,
10];
Check out in 🐊Putout Editor.
1import {safeAlign} from 'eslint-plugin-putout/config'; 2 3export default [ 4 ...safeAlign, { 5 files: ['*.d.ts'], 6 rules: { 7 'no-var': 'off', 8 }, 9 }, { 10 files: ['*.spec.*'], 11 rules: { 12 'node/no-extraneous-import': 'off', 13 }, 14 }, 15];
1import {safeAlign} from 'eslint-plugin-putout/config'; 2 3const config = matchToFlat({ 4 '*.d.ts': { 5 'no-var': 'off', 6 }, 7 '*.spec.*': { 8 'node/no-extraneous-import': 'off', 9 }, 10}); 11 12export default [ 13 ...safeAlign, 14 ...config, 15];
1{ 2 "extends": [ 3 "plugin:putout/recommended", 4 "plugin:node/recommended" 5 ], 6 "plugins": [ 7 "putout", 8 "node" 9 ] 10}
1{ 2 "extends": [ 3 "plugin:node/recommended", 4 "plugin:putout/recommended" 5 ], 6 "plugins": [ 7 "putout", 8 "node" 9 ] 10}
1{ 2 "extends": [ 3 "plugin:node/recommended", 4 "plugin:putout/ide" 5 ], 6 "plugins": [ 7 "putout", 8 "node" 9 ] 10}
1{ 2 "extends": [ 3 "plugin:node/recommended", 4 "plugin:putout/safe" 5 ], 6 "plugins": [ 7 "putout", 8 "node" 9 ] 10}
Check it out in 🐊Putout Editor.
1{ 2 "overrides": [{ 3- "files": "test/*.js", 4+ "files": ["test/*.js"], 5 "rules": { 6 "node/no-missing-require": "off" 7 } 8 }], 9};
node/no-missing-require
has no sense when type=module
in package.json
.
Check it out in 🐊Putout Editor.
1{ 2 "overrides": [{ 3 "files": "test/*.js", 4 "rules": { 5- "node/no-missing-require": "off" 6+ "node/no-missing-import": "off" 7 } 8 }], 9 "extends": [ 10 "plugin:node/recommended", 11 "plugin:putout/recommended" 12 ], 13 "plugins": [ 14 "putout", 15 "node" 16 ] 17};
node/remove-no-unpublished-require
should be enabled, since this is a very useful rule, which shows what files should be add to .npmignore
.
1{ 2 "overrides": [{ 3 "files": "test/*.js", 4 "rules": { 5- "node/no-unpublished-require": "off" 6 } 7 }], 8 "extends": [ 9 "plugin:node/recommended", 10 "plugin:putout/recommended" 11 ], 12 "plugins": [ 13 "putout", 14 "node" 15 ] 16};
node/remove-no-unsupported-features
is already disabled in eslint-plugin-putout.
1{ 2 "overrides": [{ 3 "files": "test/*.js", 4 "rules": { 5- "node/no-unpublished-require": "off" 6 } 7 }], 8 "extends": [ 9 "plugin:node/recommended", 10 "plugin:putout/recommended" 11 ], 12 "plugins": [ 13 "putout", 14 "node" 15 ] 16};
overrides
with rules: {}
has no sense. Check out in 🐊Putout Editor:
Remove overrides
with one element with empty rules
:
1{ 2- "overrides": [{ 3- "files": "test/*.js", 4- "rules": { 5- } 6- }], 7 "extends": [ 8 "plugin:node/recommended", 9 "plugin:putout/recommended" 10 ], 11 "plugins": [ 12 "putout", 13 "node" 14 ] 15};
Or remove empty overrides
:
1{ 2- "overrides": [], 3 "extends": [ 4 "plugin:node/recommended", 5 "plugin:putout/recommended" 6 ], 7 "plugins": [ 8 "putout", 9 "node" 10 ] 11};
And ofcourse remove only elements with empty rules
:
1{ 2 "overrides": [{ 3- "files": "test/*.js", 4- "rules": { 5- } 6- }, { 7 "files": "test/*.js", 8 "rules": { 9 "no-semi": "off" 10 } 11 }], 12 "extends": [ 13 "plugin:node/recommended", 14 "plugin:putout/recommended" 15 ], 16 "plugins": [ 17 "putout", 18 "node" 19 ] 20};
In flat config files, the
globals
, andparserOptions
are consolidated under thelanguageOptions
key;(c) eslint.org
Check out in 🐊Putout Editor
1const ruleTester = new RuleTester({ 2 languageOptions: { 3 parserOptions: { 4 ecmaVersion: 2025, 5 sourceType: 'module', 6 }, 7 }, 8});
1const ruleTester = new RuleTester({
2 languageOptions: {
3 ecmaVersion: 2025,
4 sourceType: 'module',
5 },
6});
Checkout in 🐊Putout Editor.
1import {safeAlign} from 'eslint-plugin-putout/config';
1import {safeAlign} from 'eslint-plugin-putout';
Checkout in 🐊Putout Editor.
1export default createESLintConfig([safeAlign]);
1export default safeAlign;
Checkout in 🐊Putout Editor.
1export default createESLintConfig([ 2 safeAlign, 3 ...matchToFlat(match), 4]);
1export default createESLintConfig([safeAlign, matchToFlat(match)]);
eslint-plugin-node
is no longer supported. Better to use eslint-plugin-n
.
1{ 2 "extends": [ 3 "plugin:putout/safe+align", 4- "plugin:node/recommended" 5+ "plugin:n/recommended" 6 ], 7 "plugins": [ 8 "putout", 9- "node" 10+ "n" 11 ] 12}
node/remove-no-missing-require
and node/remove-no-missing-import
doesn't supports exports
and already disabled by eslint-plugin-putout
.
1{ 2 "overrides": [{ 3 "files": "test/*.js", 4 "rules": { 5- "node/no-missing-require": "off", 6- "node/no-missing-import": "off" 7 } 8 }], 9 "extends": [ 10 "plugin:node/recommended", 11 "plugin:putout/recommended" 12 ], 13 "plugins": [ 14 "putout", 15 "node" 16 ] 17};
Fixes code after convert-array-copy-to-slice
.
Checkout in 🐊Putout Editor.
1export default x.slice(); 2 3module.exports = x.slice();
1export default x; 2 3module.exports = x;
Checkout in 🐊Putout Editor.
1export default defineConfig([safeAlign]);
1export default safeAlign;
Checkout in 🐊Putout Editor.
1module.exports = [ 2 ...safeAlign, { 3 rules: {}, 4 }, 5];
1module.exports = safeAlign;
Checkout in 🐊Putout Editor.
1import {safeAlign} from 'eslint-plugin-putout'; 2 3export let match; 4export default createESLintConfig([safeAlign, matchToFlat(match)]);
1import {safeAlign} from 'eslint-plugin-putout'; 2 3export default safeAlign;
Fixes apply-match-to-flat. Checkout in 🐊Putout Editor.
1module.exports.match = { 2 'bin/**': { 3 'no-process-exit': 'off', 4 }, 5}; 6 7module.exports = [ 8 ...safeAlign, { 9 rules: { 10 'node/no-unsupported-features/node-builtins': 'off', 11 }, 12 }, 13 ...matchToFlat(match), 14];
1const match = { 2 'bin/**': { 3 'no-process-exit': 'off', 4 }, 5}; 6 7module.exports = [ 8 ...safeAlign, { 9 rules: { 10 'node/no-unsupported-features/node-builtins': 'off', 11 }, 12 }, 13 ...matchToFlat(match), 14]; 15 16module.exports.match = match;
Declare:
On the surface, using a plugin in
flat config
looks very similar to using a plugin ineslintrc
. The big difference is thateslintrc
usedstring
s whereasflat configs
usesobject
s. Instead of specifying the name of a plugin, you import the plugin directly and place it into the pluginskey
.(c) eslint.org
Checkout in 🐊Putout Editor.
1import {types} from 'putout'; 2 3const {react} = types; 4 5export default { 6 plugins: [react], 7}; 8 9module.exports = { 10 plugins: ['react'], 11};
1import {types} from 'putout'; 2 3const {react} = types; 4 5export default { 6 plugins: { 7 react, 8 }, 9}; 10 11module.exports = { 12 plugins: ['react'], 13};
Checkout in 🐊Putout Editor:
Converts .eslintrc.json
:
1{ 2 "root": true, 3 "parser": "@typescript-eslint/parser", 4 "env": { 5 "node": true 6 }, 7 "extends": ["eslint:recommended"], 8 "plugins": ["@nx"], 9 "rules": { 10 "@typescript-eslint/explicit-module-boundary-types": "error" 11 }, 12 "overrides": [{ 13 "files": ["*.json"], 14 "parser": "jsonc-eslint-parser" 15 }, { 16 "files": [ 17 "*.ts", 18 "*.tsx", 19 "*.js", 20 "*.jsx" 21 ], 22 "rules": { 23 "@nx/enforce-module-boundaries": ["error", { 24 "enforceBuildableLibDependency": true, 25 "allow": [], 26 "depConstraints": [{ 27 "sourceTag": "*", 28 "onlyDependOnLibsWithTags": ["*"] 29 }] 30 }] 31 } 32 }] 33}
To .eslint.config.js
:
1const nxPlugin = require('@nx/eslint-plugin'); 2const js = require('@eslint/js'); 3const globals = require('globals'); 4const jsoncParser = require('jsonc-eslint-parser'); 5const tsParser = require('@typescript-eslint/parser'); 6 7module.exports = [ 8 js.configs.recommended, { 9 plugins: { 10 '@nx': nxPlugin, 11 }, 12 }, { 13 languageOptions: { 14 parser: tsParser, 15 globals: { 16 ...globals.node, 17 }, 18 }, 19 rules: { 20 '@typescript-eslint/explicit-module-boundary-types': ['error'], 21 }, 22 }, { 23 files: ['*.json'], 24 languageOptions: { 25 parser: jsoncParser, 26 }, 27 rules: {}, 28 }, { 29 files: [ 30 '*.ts', 31 '*.tsx', 32 '*.js', 33 '*.jsx', 34 ], 35 rules: { 36 '@nx/enforce-module-boundaries': ['error', { 37 enforceBuildableLibDependency: true, 38 allow: [], 39 depConstraints: [{ 40 sourceTag: '*', 41 onlyDependOnLibsWithTags: ['*'], 42 }], 43 }], 44 }, 45 }];
MIT
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More