forked from alangpierce/sucrase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
113 lines (113 loc) · 3.69 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
module.exports = {
extends: [
"airbnb-base",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: `${__dirname}/tsconfig.json`,
},
plugins: ["prettier", "@typescript-eslint"],
rules: {
camelcase: "off",
"class-methods-use-this": "off",
"func-names": "off",
"import/extensions": "off",
// This rule has TypeScript false positives, so just disable for now.
"import/named": "off",
"import/no-cycle": "off",
// Currently we need to do relative imports for cross-project references.
// This could be resolved by switching to lerna or yarn workspaces.
"import/no-relative-packages": "off",
"import/order": [
"error",
{
groups: [
["builtin", "external", "internal"],
["unknown", "parent", "sibling", "index"],
"object",
],
"newlines-between": "always",
alphabetize: {order: "asc", caseInsensitive: true},
},
],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"**/benchmark/**",
"**/example-runner/**",
"**/generator/**",
"**/test/**",
"**/spec-compliance-tests/**",
"**/script/**",
],
optionalDependencies: false,
},
],
"import/no-mutable-exports": "off",
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
"lines-between-class-members": "off",
"max-classes-per-file": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-constant-condition": ["error", {checkLoops: false}],
"no-continue": "off",
"no-else-return": "off",
"no-empty-function": "off",
"no-fallthrough": "off",
"no-labels": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-restricted-syntax": "off",
"no-restricted-globals": "off",
"no-shadow": "off",
"no-undef": "off",
"no-underscore-dangle": "off",
"no-unused-vars": "off",
"no-use-before-define": "off",
// False positive on TS constructors with initializers.
"no-useless-constructor": "off",
"prefer-destructuring": "off",
"prettier/prettier": "error",
strict: "off",
"@typescript-eslint/array-type": ["error", {default: "generic"}],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/explicit-function-return-type": ["error", {allowExpressions: true}],
// Disable in favor of explicit-function-return-type.
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-confusing-void-expression": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": ["error", {args: "none"}],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
allowAny: true,
allowNullish: true,
},
],
"@typescript-eslint/typedef": "error",
},
settings: {
"import/extensions": [".js", ".ts", ".tsx"],
"import/resolver": {
node: {
extensions: [".js", ".ts", ".tsx"],
},
},
},
};