JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16644
  • Score
    100M100P100Q134829F
  • License MIT

Report and fix EditorConfig rule violation

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

CircleCI NPM Version

Install

$ yarn add --dev eslint eslint-plugin-editorconfig

or

$ npm install --save-dev eslint eslint-plugin-editorconfig

Usage

Like other ESLint plugins,

  • add editorconfig in the rules.
  • add "editorconfig" in the plugins.
{
  // ...
  "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.

License

MIT