-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypescript.js
75 lines (75 loc) · 2.26 KB
/
typescript.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module.exports = {
ignorePatterns: ['bin', 'node_modules'],
extends: [
'airbnb-base',
'plugin:import/typescript',
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
ecmaFeatures: {
jsx: true
}
},
env: {
browser: true,
es6: true
},
parser: "@typescript-eslint/parser",
plugins: ["import", "prettier", "@typescript-eslint"],
rules: {
// prettier
"prettier/prettier": ["error"],
// TypeScript
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [ "off", { "accessibility": "explicit" } ],
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style":
[ "error",
{
"multiline": { "delimiter": "semi", "requireLast": true },
"singleline": { "delimiter": "semi", "requireLast": false }
}
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/quotes": ["error", "single", { "allowTemplateLiterals": true }],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none" }],
"@typescript-eslint/no-object-literal-type-assertion": "off",
// v4 changes
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
// import
"import/no-deprecated": "warn",
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
mjs: "never",
jsx: "never",
ts: "never",
tsx: "never"
}
]
},
};