-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc
62 lines (62 loc) · 2.23 KB
/
.eslintrc
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
55
56
57
58
59
60
61
62
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"semistandard",
"plugin:n/recommended", // Uses the recommended rules from eslint-plugin-n (node)
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier" // enables eslint-plugin-prettier and displays prettier errors as ESLint errors. (must be the last config in extends array)
],
"ignorePatterns": ["node_modules/", "artifacts", "dist", "generated"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2018,
"sourceType": "module" // Allows for the use of imports
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
"project": "./tsconfig.json"
}
}
},
"rules": {
"comma-dangle": ["warn", "always-multiline"],
"curly": ["error", "all"],
"max-len": ["error", { "code": 120 }],
"no-nested-ternary": "error",
"padded-blocks": "off",
"space-before-function-paren": "off",
"no-useless-constructor": "off",
"n/no-process-exit": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-missing-import": "off", // disable as it conflicts with TS compiling to ES modules.
"import/no-unresolved": "error", // replaces the above n/no-missing-import
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off", // should be enabled once we migrated all js to ts files
"prettier/prettier": "error", // Ensure Prettier discrepancies are treated as errors
"import/order": [
1,
{
"groups": ["builtin", "external", "internal", ["parent", "sibling", "index"], "object", "type"],
"alphabetize": { "order": "asc", "caseInsensitive": true },
"newlines-between": "always"
}
]
},
"plugins": [
"import",
"@typescript-eslint",
"prettier" // so prettier errors shows up in eslint
],
"root": true
}