Skip to content

Commit d4d4bd4

Browse files
committed
Update README
1 parent 062196f commit d4d4bd4

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
# eslint-config-codility
2+
23
Codility's shared ESLint config.
34

45
## Usage
5-
1. Install the package: `yarn add @codility/eslint-config-codility -D -E`
6-
2. Install peer dependencies
6+
7+
1. Install the package: `yarn add @codility/eslint-config-codility --dev --exact`
8+
2. Install peer dependencies and optional dependencies if needed
79
3. Add `.eslintrc.js` file:
8-
```
9-
/* eslint-disable strict */
10+
* For the vanilla JS version use this:
11+
```
12+
/* eslint-disable strict */
1013
11-
'use strict';
14+
'use strict';
1215
13-
module.exports = {
14-
extends: ['@codility/eslint-config-codility'],
15-
};
16-
```
16+
module.exports = {
17+
extends: ['@codility/eslint-config-codility'],
18+
};
19+
```
20+
* For the React version use this:
21+
```
22+
/* eslint-disable strict */
23+
24+
'use strict';
25+
26+
module.exports = {
27+
extends: ['@codility/eslint-config-codility/react'],
28+
};
29+
```
1730
4. Add `scripts` to your `package.json`:
1831
```
1932
"lint": "eslint .",
@@ -22,6 +35,10 @@ module.exports = {
2235
5. Run lint with `yarn lint`
2336
6. Let the tool fix your code: `yarn lint:fix`
2437

38+
## Migrating to v.2
39+
40+
Previously the only version available included React plugins and had React as a peer dependency, which was annoying for projects that didn't involve it. That version is now available as `@codility/eslint-config-codility/react` - simply add `/react` at the end.
41+
2542
## Warnings vs errors rationale
2643

2744
Rules for setting up the rules:
@@ -30,7 +47,7 @@ Rules for setting up the rules:
3047
- we don't care about the rule
3148
- we really don't
3249
- 1 (warn):
33-
- the code can run, but we don't want it on production
50+
- the code can run, but we don't want it on production (e.g. `console.log` or `debugger`)
3451
- stylistic errors
3552
- 2 (error):
3653
- the code can't run

0 commit comments

Comments
 (0)