Package Exports
- eslint-plugin-editorconfig
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-editorconfig) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-editorconfig
ESLint plugin to follow EditorConfig
Install
$ yarn add --dev eslint eslint-plugin-editorconfigor
$ npm install --save-dev eslint eslint-plugin-editorconfigUsage
Like other ESLint plugins,
- add
editorconfigin therules. - add
"editorconfig"in theplugins.
{
// ...
"rules": {
"editorconfig/editorconfig": "error"
},
"plugins": [ "editorconfig" ]
}Conflicting ESLint rules
Following rules may conflicts editorconfig rule.
It is recommended to disable them.
- eol-last
- indent
- linebreak-style
- no-trailing-spaces
- unicode-bom
If above rules are specified in your .eslintrc, just remove them.
If they are specified in the extended config, consider adding plugin:editorconfig/noconflict to your extends.
{
"extends": [
"@phanect/phanective",
"plugin:editorconfig/noconflict"
],
// ...
}Passing options
Internally, eslint-plugin-editorconfig uses above options to verify/fix JS code. You can pass options to some rules.
{
// ...
"rules": {
"editorconfig/editorconfig": [ "error", {
"indent": { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 }},
"no-trailing-spaces": { "skipBlankLines": true, "ignoreComments": true },
}]
},
"plugins": [ "editorconfig" ]
}Currently, following rules are supported. See original rule documents for supported options.
Unsupported EditorConfig Parameters
Some of the EditorConfig parameters are unsupported.
end_of_line
When end_of_line = cr is specified in .editorconfig, ESLint does nothing.
charset
This plugin works only when utf-8 or utf-8-bom is specified. If other value is specified in .editorconfig, charset is not verified by ESLint.
ESLint only verifies if BOM is specified or not.