eslint-plugin-iqvia
This package includes the shareable ESLint configuration used by IQVIA.
Usage in Projects
-
Install this package and ESLint:
yarn add --dev eslint-plugin-iqvia eslint@4.19.1 -
Either add the following line to your
package.json
file:"eslintConfig":Or, add a
.eslintrc.js
file instead:moduleexports =extends:"eslint:recommended""plugin:iqvia/recommended"; -
Enable running from the command line by adding these scripts to
package.json
:"scripts":,usage:
$ yarn lint -
Enable linting on every commit by adding a commit hook:
Install husky and lint-staged:
yarn add --dev husky@0.14.3 lint-staged@6.0.0Then add the following to
package.json
:"scripts":,"lint-staged":,
That's it! Learn more about configuring ESLint on the ESLint website.
Extends:
Rules:
- arrow-body-style
- brace-style
- curly
- func-style
- import/newline-after-import
- import/no-named-as-default
- import/extensions
- import/order
- jasmine/missing-expect
- jasmine/no-spec-dupes
- jasmine/no-suite-dupes
- jest/prefer-to-be-null
- jest/prefer-to-be-undefined
- no-use-before-define
- no-sequences
- no-tabs
- no-trailing-spaces
- no-var
- object-shorthand
- one-var
- one-var-declaration-per-line
- prefer-arrow-callback
- prefer-const
- prettier
- qi-react-intl
- react/jsx-boolean-value
- react/jsx-key
- react/jsx-no-literals
- react/no-array-index-key
- sort-imports
- ternaries