eslint-plugin-iqvia

ESLint configuration used by IQVIA

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-plugin-iqvia
0.0.225 years ago5 years agoMinified + gzip package size for eslint-plugin-iqvia in KB

Readme

eslint-plugin-iqvia
This package includes the shareable ESLint configuration used by IQVIA.

Usage in Projects

  1. Install this package and ESLint:
```sh
yarn add --dev eslint-plugin-iqvia eslint@4.19.1
```
  1. Either add the following line to your package.json file:
```json
"eslintConfig": {
  "extends": [
    "eslint:recommended",
    "plugin:iqvia/recommended"
  ]
}
```

Or, add a `.eslintrc.js` file instead:
```js
module.exports = {
  extends: [
    "eslint:recommended",
    "plugin:iqvia/recommended",
  ],
};
```
  1. Enable running from the command line by adding these scripts to package.json:
```json
"scripts": {
  ...
  "linter": "eslint --max-warnings 0",
  "lint": "yarn linter . --ignore-pattern '!.*'"
},
```

usage:
```sh
$ yarn lint
```
  1. Enable linting on every commit by adding a commit hook:
Install husky and lint-staged:
```sh
yarn add --dev husky@0.14.3 lint-staged@6.0.0
```

Then add the following to `package.json`:
```json
"scripts": {
  ...
  "precommit": "lint-staged"
},
"lint-staged": {
  "./*.js": "lint"
},
```
That's it! Learn more about configuring ESLint on the ESLint website.

Extends:

Rules: