-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
54 lines (51 loc) · 1.51 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"airbnb",
"plugin:@typescript-eslint/recommended",
"prettier",
],
env: {
node: true,
browser: true,
},
overrides: [
// typescript/no-var-requires should only be enabled on ts/tsx files
// https://github.com/Shopify/eslint-plugin-shopify/issues/159#issuecomment-485813838
{
files: ["*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
settings: {
// https://stackoverflow.com/questions/55198502/using-eslint-with-typescript-unable-to-resolve-path-to-module
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
},
},
},
rules: {
// https://stackoverflow.com/questions/59265981/typescript-eslint-missing-file-extension-ts-import-extensions
"import/extensions": [
"error",
"ignorePackages",
{
ts: "never",
tsx: "never",
},
],
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md#disallow-variable-declarations-from-shadowing-variables-declared-in-the-outer-scope-no-shadow
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-underscore-dangle": ["error", { allowAfterThis: true }],
"no-console": "off",
"import/prefer-default-export": "off",
"class-methods-use-this": "off",
},
};