{"id":19732,"library":"eslint-plugin-editorconfig","title":"eslint-plugin-editorconfig","description":"ESLint plugin (v4.0.3) that enforces EditorConfig rules using existing ESLint and optional @typescript-eslint rules. Released under MIT, updated ~monthly. Key differentiator: automatically reads .editorconfig and applies charset, indent, linebreak, trailing spaces, and eol-last rules, avoiding duplicate configuration. Since v4.0.0, @typescript-eslint/eslint-plugin is no longer a dependency; must be installed separately for TS files. Supports ESLint 8.x, Flat config (v4+), and offers 'all' and 'noconflict' configs.","status":"active","version":"4.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/phanect/eslint-plugin-editorconfig","tags":["javascript","eslint","eslintplugin","editorconfig"],"install":[{"cmd":"npm install eslint-plugin-editorconfig","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-editorconfig","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-editorconfig","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the plugin is an ESLint plugin","package":"eslint","optional":false},{"reason":"required only if linting TypeScript files, removed as peer dependency in v4","package":"@typescript-eslint/eslint-plugin","optional":true}],"imports":[{"note":"ESLint plugin is configured via plugins array, not imported directly. For flat config, import the plugin: import editorconfig from 'eslint-plugin-editorconfig'","wrong":"require('eslint-plugin-editorconfig') as object","symbol":"plugin (as ESLint plugin)","correct":"plugins: ['editorconfig'] in .eslintrc"},{"note":"ESLint requires 'plugin:' prefix when referring to a plugin config","wrong":"extends: ['editorconfig/all']","symbol":"all config","correct":"extends: ['plugin:editorconfig/all']"},{"note":"Disables conflicting built-in ESLint rules","wrong":"extends: ['editorconfig/noconflict']","symbol":"noconflict config","correct":"extends: ['plugin:editorconfig/noconflict']"},{"note":"All rules must be prefixed with 'editorconfig/'","wrong":"rules: { 'charset': 'error' }","symbol":"rules","correct":"rules: { 'editorconfig/charset': 'error' }"}],"quickstart":{"code":"// Install:\n// npm install --save-dev eslint eslint-plugin-editorconfig\n\n// .eslintrc.json:\n{\n  \"extends\": [\"plugin:editorconfig/all\"],\n  \"plugins\": [\"editorconfig\"]\n}\n\n// .editorconfig (example):\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n// Run:\n// npx eslint .","lang":"json","description":"Shows minimal setup with all rules enabled via 'plugin:editorconfig/all' and a sample .editorconfig file."},"warnings":[{"fix":"If you lint TypeScript files, run: npm install --save-dev @typescript-eslint/eslint-plugin","message":"Removed @typescript-eslint/eslint-plugin as a dependency; must install manually","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use individual rules (charset, eol-last, indent, linebreak-style, no-trailing-spaces) or extend 'plugin:editorconfig/all'","message":"editorconfig/editorconfig rule removed; replaced with separate rules","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use import editorconfig from 'eslint-plugin-editorconfig'; then export default [...editorconfig.configs.recommended]","message":"Flat config (eslint.config.js) requires import; not supported in legacy configs","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Either remove those rules from config or extend 'plugin:editorconfig/noconflict' to disable them","message":"Conflicts with built-in ESLint rules (eol-last, indent, linebreak-style, no-trailing-spaces, unicode-bom) and @typescript-eslint equivalents","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Update to Node >=14 and ESLint >=8","message":"Node <14 and ESLint <8 not supported in v4+","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev eslint-plugin-editorconfig","cause":"Plugin not installed","error":"Error: Failed to load plugin 'editorconfig' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-editorconfig'"},{"fix":"Ensure 'editorconfig' is in plugins array and extends string is 'plugin:editorconfig/all'","cause":"Missing 'plugin:' prefix or plugin not installed","error":"Error: Failed to load config 'plugin:editorconfig/all' to extend from"},{"fix":"Use: import editorconfig from 'eslint-plugin-editorconfig' (ESM) or const editorconfig = require('eslint-plugin-editorconfig') (CJS) in eslint.config.js","cause":"Trying to import plugin as function in flat config without correct import","error":"TypeError: eslint-plugin-editorconfig is not a function or export expected"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}