Registry / testing / eslint-plugin-editorconfig

eslint-plugin-editorconfig

JSON →
library4.0.3jsnpmunverified

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.

npm install eslint-plugin-editorconfig
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-EDIT
E
eslint-plugin-editorconfig
testingjavascriptv4.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin (as ESLint plugin)
plugins: ['editorconfig'] in .eslintrc
require('eslint-plugin-editorconfig') as object
ESLint plugin is configured via plugins array, not imported directly. For flat config, import the plugin: import editorconfig from 'eslint-plugin-editorconfig'
all config
extends: ['plugin:editorconfig/all']
extends: ['editorconfig/all']
ESLint requires 'plugin:' prefix when referring to a plugin config
noconflict config
extends: ['plugin:editorconfig/noconflict']
extends: ['editorconfig/noconflict']
Disables conflicting built-in ESLint rules
rules
rules: { 'editorconfig/charset': 'error' }
rules: { 'charset': 'error' }
All rules must be prefixed with 'editorconfig/'

Shows minimal setup with all rules enabled via 'plugin:editorconfig/all' and a sample .editorconfig file.

// Install: // npm install --save-dev eslint eslint-plugin-editorconfig // .eslintrc.json: { "extends": ["plugin:editorconfig/all"], "plugins": ["editorconfig"] } // .editorconfig (example): root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true // Run: // npx eslint .
Debug
Known issues
breakingRemoved @typescript-eslint/eslint-plugin as a dependency; must install manually
fix
If you lint TypeScript files, run: npm install --save-dev @typescript-eslint/eslint-plugin
affects: >=4.0.0
breakingeditorconfig/editorconfig rule removed; replaced with separate rules
fix
Use individual rules (charset, eol-last, indent, linebreak-style, no-trailing-spaces) or extend 'plugin:editorconfig/all'
affects: >=3.0.0
gotchaFlat config (eslint.config.js) requires import; not supported in legacy configs
fix
Use import editorconfig from 'eslint-plugin-editorconfig'; then export default [...editorconfig.configs.recommended]
affects: >=4.0.0
gotchaConflicts with built-in ESLint rules (eol-last, indent, linebreak-style, no-trailing-spaces, unicode-bom) and @typescript-eslint equivalents
fix
Either remove those rules from config or extend 'plugin:editorconfig/noconflict' to disable them
affects: >=0.0.0
deprecatedNode <14 and ESLint <8 not supported in v4+
fix
Update to Node >=14 and ESLint >=8
affects: >=4.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'editorconfig' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-editorconfig'
Plugin not installed
fix
Run: npm install --save-dev eslint-plugin-editorconfig
Error: Failed to load config 'plugin:editorconfig/all' to extend from
Missing 'plugin:' prefix or plugin not installed
fix
Ensure 'editorconfig' is in plugins array and extends string is 'plugin:editorconfig/all'
TypeError: eslint-plugin-editorconfig is not a function or export expected
Trying to import plugin as function in flat config without correct import
fix
Use: import editorconfig from 'eslint-plugin-editorconfig' (ESM) or const editorconfig = require('eslint-plugin-editorconfig') (CJS) in eslint.config.js
Upgrade
Version history
4.0.3latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; the plugin is an ESLint plugin
@typescript-eslint/eslint-pluginoptionalrequired only if linting TypeScript files, removed as peer dependency in v4
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-editorconfig — npm install eslint-plugin-editorconfig · libregistry