Skip to content

Commit b5fb42a

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [NPM] ESLint airbnb rules added.
1 parent 25946bc commit b5fb42a

File tree

3 files changed

+1607
-287
lines changed

3 files changed

+1607
-287
lines changed

.eslintrc

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@
44
"parserOptions": {
55
"project": true
66
},
7-
"plugins": ["@typescript-eslint", "jest", "prettier"],
7+
"plugins": [
8+
"@typescript-eslint",
9+
"import",
10+
"jest",
11+
"prettier"],
812
"extends": [
913
"eslint:recommended",
1014
"plugin:@typescript-eslint/eslint-recommended",
1115
"plugin:@typescript-eslint/recommended",
1216
// "plugin:@typescript-eslint/recommended-type-checked",
17+
// "plugin:@typescript-eslint/stylistic-type-checked"
18+
"airbnb-base",
1319
"prettier",
14-
// "plugin:import/errors",
15-
// "plugin:import/warnings",
20+
"plugin:import/recommended",
21+
"plugin:import/errors",
22+
"plugin:import/warnings",
1623
"plugin:jest/all"
1724
],
1825
"rules": {
@@ -21,6 +28,15 @@
2128
// CUSTOM OVERRIDES
2229
// TODO: remove no-restricted-syntax override and replace for...Of due
2330
/// "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations."
31+
"import/extensions": [
32+
"error",
33+
"always",
34+
{
35+
"pattern": {
36+
"ts": "never"
37+
}
38+
}
39+
],
2440
"no-restricted-syntax": 0,
2541
"no-console": "off",
2642
"no-underscore-dangle": 0,
@@ -37,5 +53,16 @@
3753
"@typescript-eslint/explicit-function-return-type": "error"
3854
}
3955
}
40-
]
56+
],
57+
"settings": {
58+
"import/parsers": {
59+
"@typescript-eslint/parser": [".ts", ".tsx"]
60+
},
61+
"import/resolver": {
62+
"typescript": {
63+
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn"t contain any source code, like `@types/unist`
64+
"project": "."
65+
}
66+
}
67+
}
4168
}

0 commit comments

Comments
 (0)