You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,17 @@
3
3
Plain config without any rules that makes ESLint working with typescript
4
4
5
5
## How to use.
6
+
6
7
- Install it as a dependency.
8
+
7
9
```
8
10
yarn add eslint-config-plain-typescript
9
11
```
10
-
- Make sure you have `typescript` and `tsconfig.json` in root of the project
12
+
13
+
- Make sure you have `typescript` and `tsconfig.json` in root of the project
11
14
12
15
- Add in your `.eslintrc` extension like that:
16
+
13
17
```
14
18
"extends": ["plain-typescript"]
15
19
```
@@ -20,30 +24,45 @@ Plain config without any rules that makes ESLint working with typescript
20
24
21
25
There is some rules that are not compatible with `js` so when you use them it's nice
22
26
to put the inside of the `override` object in your `.eslintrc` config like that.
27
+
23
28
```json5
24
29
{
25
-
"extends": ["airbnb", "plain-typescript"],
26
-
"overrides": {
27
-
files: ["**/*.ts", "**/*.tsx"],
28
-
"rules": { // These are rules that should apply to ts/tsx files only
29
-
"@typescript-eslint/no-unused-vars":"error"
30
+
extends: ["airbnb", "plain-typescript"],
31
+
overrides: [
32
+
{
33
+
files: ["**/*.ts", "**/*.tsx"],
34
+
rules: {
35
+
// These are rules that should apply to ts/tsx files only
36
+
"@typescript-eslint/no-unused-vars":"error"
37
+
}
30
38
}
31
-
},
32
-
"rules": { // These are rules that go for both and are proven to not be conflicting
39
+
],
40
+
rules: {
41
+
// These are rules that go for both and are proven to not be conflicting
33
42
"no-unused-vars":"error"
34
43
}
35
44
}
36
45
```
37
46
38
47
Also please refer to the `typescript`[recommended config](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json) for more info about available rules and rules that are incompatible.
39
48
49
+
## Compatibility with other plugins
50
+
51
+
Few rules are incompatible and need special plugins/configs.
52
+
For example `plugin:import/typescript` is needed to be extended so `eslint-plugin-import` will start working properly
53
+
if you will extend `airbnb` preset for example etc.
54
+
It's described [here](https://github.com/benmosher/eslint-plugin-import#typescript) in detail.
55
+
40
56
## Note
41
57
42
58
Not 100% sure, but put it after all the other configs that you may import.
43
-
The only configs that you should export after is `prettier` related stuff, others should go before this one I assume.
59
+
The only configs that you should extend after is `prettier` related stuff, others should go before this one I assume.
60
+
More on `prettier` integraion [here](https://github.com/prettier/eslint-config-prettier#installation)
44
61
45
62
## Depends on.
63
+
46
64
There three suckers gonna be installed along the way with installation.
65
+
47
66
```
48
67
"dependencies": {
49
68
"babel-eslint": "10.0.1",
@@ -53,6 +72,7 @@ There three suckers gonna be installed along the way with installation.
53
72
```
54
73
55
74
These two suckers should be installed separatly as `devDependencies`:
0 commit comments