2.1.1 • Published 6 years ago

eslint-config-pirashield v2.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

npm version

Usage

To use linting in any project, create an .eslintrc.js (stand for "eslint runtime config") file in root directory, with following minimum code:

module.exports = {
  extends: 'pirashield'
};

Then install these 3 dependencies:

npm install --save-dev eslint eslint-config-pirashield eslint-plugin-import

This loads rules for some common rules about best-practices and style that should be used in all PiraShield JavaScript repos.

React Projects

There is an additional file for React config. The separation is to avoid downloading unnecessary rules for projects that, for example, aren't front end and wouldn't use React. For these rules, use the following .eslintrc.js file

module.exports = {
  extends: [
    'pirashield',
    'pirashield/react'
  ],
};

Then, you must install following 4 dependencies (note there is one extra plugin eslint-plugin-react)

npm install --save-dev eslint eslint-config-pirashield eslint-plugin-import eslint-plugin-react

Customizing

To add custom rules to a project/override, add rules property to .eslintrc.json, like so:

module.exports = {
  extends: [
    'pirashield',
    'pirashield/react',
  ],
  rules: {
    'import/no-extraneous-dependencies': 'off',
    'arrow-body-style': 'warn',
    'some-other-rule': 'error'
  }
}

See all available rules on the Eslint docs.

2.1.1

6 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago