Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-moxy

moxystudio1.1kMITdeprecated9.1.1

Package renamed to @moxy/eslint-config

MOXY eslint configuration to be used across several JavaScript projects

eslint-config, eslintconfig, eslint, lint, linter, style

readme

eslint-config-moxy

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status

MOXY eslint configuration to be used across several JavaScript projects.

Installation

$ npm install --save-dev eslint eslint-config-moxy

NOTE: npm v3 or greater is required for this package to work correctly until #3458 is resolved.

Usage

Create a .eslintrc.json file in the project root using a base configuration and addons.

First you need to choose the base configuration to use:

  • es5 - The configuration to be used in ECMAScript 5 based projects
  • es6 - The configuration to be used in ECMAScript 6 based projects (aka 2015)
  • es7 - The configuration to be used in ECMAScript 7 based projects (aka 2016)
  • es8 - The configuration to be used in ECMAScript 8 based projects (aka 2017)
  • es9 - The configuration to be used in ECMAScript 9 based projects (aka 2018)
  • es10 - The configuration to be used in ECMAScript 9 based projects (aka 2019)

Then enhance it with one or more addons:

  • browser - If you are going to develop code for the browser (assumes you use CommonJS or AMD)
  • node - If you are going to develop code for NodeJS
  • es-modules: If you are going to use ES6 import & export instead of CommonJS or AMD (this rule skips root [...].config.js files to avoid ignoring this rule in common configuration files)
  • babel-parser: Use babel-eslint parser so that you may use language features that are not yet implemented in eslint (e.g.: dynamic imports)
  • react - If you are going to use React (requires es6 base configuration or higher)
  • jest - If you are going to use Jest to develop tests

Examples

Cutting edge React in the browser:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es9",
        "eslint-config-moxy/addons/browser",
        "eslint-config-moxy/addons/es-modules",
        "eslint-config-moxy/addons/react"
    ]
}

Cutting edge NodeJS:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es9",
        "eslint-config-moxy/addons/node"
    ]
}

Cutting edge NodeJS with ES modules (requires a transpiler such as Babel or similar):

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es9",
        "eslint-config-moxy/addons/node",
        "eslint-config-moxy/addons/es-modules"
    ]
}

Old ES5 in the browser:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es5",
        "eslint-config-moxy/addons/browser"
    ]
}

Note that by setting root to true, we ensure that no ancestor configuration is used which also improves ESLint performance because no more file lookups need to be done.

Tests

$ npm test
$ npm test -- --watch during development

License

MIT License

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

9.1.1 (2019-11-15)

Bug Fixes

  • fix babel-parser addon not having new rules configured (c53cb82)

9.1.0 (2019-10-13)

Features

  • add ECMA 2019 support (es10) (0ddb47d)

9.0.1 (2019-10-13)

Bug Fixes

  • only override prefer-import for root config files (dcd65a9), closes #73

9.0.0 (2019-10-13)

⚠ BREAKING CHANGES

  • eslint v6 is now required

Features

8.1.0 (2019-10-10)

Features

8.0.0 (2019-09-12)

Features

BREAKING CHANGES

  • Drop support for Node v6

7.1.0 (2019-03-18)

Bug Fixes

Features

  • enable react/default-props-match-prop-types (0b572b5)

7.0.1 (2019-02-23)

7.0.0 (2019-02-23)

Chores

Features

BREAKING CHANGES

  • jest and jsdoc rules changed

Also:

  • Add jest/prefer-to-have-length
  • Remove deprecated valid-jsdoc in favor of using more jsdoc plugin rules
  • Specify the react version as auto-detect

6.1.1 (2018-09-16)

Bug Fixes

  • lock babel-eslint version due to a bug (7e2a8fe)

6.1.0 (2018-09-12)

Features

  • use built-in prefer-object-spread (9859072)

6.0.1 (2018-08-06)

6.0.0 (2018-08-06)

Features

BREAKING CHANGES

  • removed addons/object-spread, use es9 base config instead
  • renamed addons/es6-modules to addons/es-modules

5.5.3 (2018-07-20)

Bug Fixes

  • add missing defaultProps (8998aed)

5.5.2 (2018-07-20)

Bug Fixes

  • ensure static lifecyle methods com before instance variables (9db7d9d)

5.5.1 (2018-07-20)

Bug Fixes

  • fix static methods reporting out-of-order in CRA apps (be5a391)

5.5.0 (2018-07-20)

Features

  • allow setState in didMount and didUpdate (dd7fb66)

5.4.1 (2018-04-28)

Bug Fixes

  • ignore indentation on template literals (60d6336)

5.4.0 (2018-04-22)

Features

  • add es9 base configuration (9c8fca8)

5.3.0 (2018-04-22)

Features

5.2.1 (2018-03-18)

Bug Fixes

  • allow scoped requires in Jest modules (#52) (6269e6d), closes #50
  • disable Jest addon for source files (#48) (08bf0c6), closes #31

5.2.0 (2018-02-27)

Features

  • ignore template literals in max-len rule (519ba03), closes #49

5.1.0 (2018-02-19)

Bug Fixes

  • fix invalid prefer-import/prefer-import-over-require (1e7e5c1)

Features

  • ignore language-reserved keywords for capitalized-comments (#38) (562edfa)
  • prefer import instead of require es6-modules (1ae4568), closes #43

5.0.0 (2018-02-05)

Chores

  • update no-restricted-properties and no-multi-spaces (f913d74), closes #37

Features

  • prefer object spread instead of object assign (23c89c6), closes #30

BREAKING CHANGES

  • multiple spaces in EOL comments are no longer allowed
  • usage of defineSetter and defineGetter are no longer allowed
  • code that doesn't use spread will not pass linting

4.2.0 (2017-12-24)

Features

4.1.2 (2017-11-21)

Bug Fixes

  • fix es7 and es7 having sourceType set to module (5e52ba5)

4.1.1 (2017-11-16)

Bug Fixes

  • update capitalized-comments to not be so strict (7e1b219)

4.1.0 (2017-11-15)

Features

  • add jest addon (406a965)
  • unused vars in rest spread siblings no longer warn (f6bebb4)

4.0.0 (2017-11-15)

Chores

  • update rules react/jsx-no-bind, react/sort-comp, react/jsx-handler-names and README; add babel-eslint (8c3f30c)

BREAKING CHANGES

  • event handler prefix of rule react/jsx-handler-names with severity 2 is now different