eslint-plugin-mysticatea
Additional ESLint rules.
:cd: Installation
npm install --save-dev eslint eslint-plugin-mysticatea
Requirements
- Node.js
^4.0.0,^6.0.0, or newer. - ESLint
^3.1.0, or newer.
:book: Usage
Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin
Rules
- mysticatea/arrow-parens enforces parens of argument lists (excludes too redundant parens) (fixable).
- mysticatea/block-scoped-var handles variables which are declared by
vardeclaration as block-scoped. It disallows redeclarations, uses from outside of the scope, shadowing. - mysticatea/no-instanceof-array disallows 'instanceof' for Array (fixable).
- mysticatea/no-instanceof-wrapper disallows 'instanceof' for wrapper objects (fixable).
- mysticatea/no-literal-call disallows a call of a literal.
- mysticatea/no-this-in-static disallows
this/superin static methods. - mysticatea/no-use-ignored-vars disallows a use of ignored variables.
- mysticatea/no-useless-rest-spread disallows unnecessary rest/spread operators (fixable).
- mysticatea/prefer-for-of requires
for-ofstatements instead ofArray#forEachor something like (fixable).
Example
.eslintrc.json
{
"plugins": [
"mysticatea"
],
"rules": {
"mysticatea/arrow-parens": "error",
"mysticatea/block-scoped-var": "error",
"mysticatea/no-instanceof-array": "error",
"mysticatea/no-instanceof-wrapper": "error",
"mysticatea/no-literal-call": "error",
"mysticatea/no-this-in-static": "error",
"mysticatea/no-use-ignored-vars": "error",
"mysticatea/no-useless-rest-spread": "error",
"mysticatea/prefer-for-of": "error",
"arrow-parens": "off",
"block-scoped-var": "off",
"no-redeclare": "off"
}
}
:anchor: Semantic Versioning Policy
eslint-plugin-mysticatea follows semantic versioning and ESLint's Semantic Versioning Policy.
- Patch release (intended to not break your lint build)
- A bug fix in a rule that results in
eslint-plugin-mysticateareporting fewer errors. - Improvements to documentation.
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
- A bug fix in a rule that results in
- Minor release (might break your lint build)
- A bug fix in a rule that results in
eslint-plugin-mysticateareporting more errors. - A new rule is created.
- A new option to an existing rule is created.
- An existing rule is deprecated.
- A bug fix in a rule that results in
- Major release (likely to break your lint build)
- A support for old Node version is dropped.
- A support for old ESLint version is dropped.
- An existing rule is removed.
- An existing option of a rule is removed.
- An existing config is updated.
:newspaper: Changelog
:muscle: Contributing
Welcome contributing!
Please use GitHub's Issues/PRs.
Development Tools
npm testruns tests and measures coverage.npm run watchruns tests and measures coverage when source code are changed.npm run coverageshows the coverage result ofnpm testcommand.npm run cleanremoves the coverage result ofnpm testcommand.