1.2.1 • Published 7 years ago

eslint-config-lenel v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

eslint-config-lenel

Build Status npm version Dependencies

An eslint config for React applications.

It contains plugins:

Installation

npm install --save-dev eslint-config-lenel

Configure .eslintrc

{
  "extends": "eslint-config-lenel"
}

Add scripts to package.json

"scripts": {
  "lint": "eslint --ext jsx --ext js .",
  "lint:fix": "npm run lint -- --fix"
}

Run scripts with -s flag

  npm run lint -s
  npm run lint:fix -s

General notes

  1. Exceptions for import/no-unresolved
    Eslint will report errors if you use aliases in webpack.
    Disable it by adding:

    'import/no-unresolved': [2, { ignore: ['^components/', '^containers/', '^services/', '^layouts/'] }]
  2. Chai and no-unused-expressions
    Eslint will report errors if you use syntax: expect(foo).to.be.true.
    Disable it by adding:

     "no-unused-expressions": 0

    If you have unit tests in a separate folder e.g test/ you can create a nested config.
    Example:
    Create test/.eslintrc and extend the base config.

    {
      "extends" : "../.eslintrc",
      "env"     : {
        "mocha" : true
      },
      "globals": {
        "expect": true,
      },
      "rules": {
        "no-unused-expressions": 0,
        "no-magic-numbers": 0,
      }
    }

Contributors

License

MIT