-
Notifications
You must be signed in to change notification settings - Fork 143
/
.eslintrc.js
109 lines (106 loc) · 3.55 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
const fs = require("fs");
const path = require("path");
const prettierConfig = fs.readFileSync(path.resolve(__dirname, "./.prettierrc"), "utf8");
const prettierOptions = JSON.parse(prettierConfig);
const isProduction = process.env.NODE_ENV === "production";
module.exports = {
root: true,
extends: [
"airbnb",
"prettier",
"plugin:import/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/typescript",
],
plugins: ["json", "prettier", "unused-imports", "import", "@typescript-eslint"],
parser: "@typescript-eslint/parser",
env: {
node: true,
mocha: true,
es2022: true,
},
settings: {
react: {
version: "999.999.999",
},
"import/resolver": {
typescript: {},
node: {
extensions: [".ts", ".js"],
moduleDirectory: ["node_modules", "ts", "src"],
},
},
},
parserOptions: {
project: path.resolve(__dirname, "./tsconfig.json"),
sourceType: "module",
typescript: true,
ecmaVersion: 2022,
experimentalDecorators: true,
requireConfigFile: false,
ecmaFeatures: {
classes: true,
impliedStrict: true,
},
warnOnUnsupportedTypeScriptVersion: true,
},
reportUnusedDisableDirectives: isProduction,
rules: {
"import/no-cycle": ["error"],
"unused-imports/no-unused-imports": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["**/*.test.ts", "**/__benchmarks__/**", "**/tests/**", "**/__tests__/**"],
},
],
"no-debugger": isProduction ? "error" : "off",
"no-console": "error",
"no-underscore-dangle": "error",
"no-redeclare": ["error", { builtinGlobals: true }],
"import/order": [
"error",
{
groups: ["external", "builtin", "internal", "type", "parent", "sibling", "index", "object"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
warnOnUnassignedImports: true,
"newlines-between": "always",
},
],
"prettier/prettier": ["error", prettierOptions],
"import/prefer-default-export": "off",
"import/extensions": ["error", { json: "always" }],
"class-methods-use-this": "off",
"prefer-promise-reject-errors": "off",
"max-classes-per-file": "off",
"no-use-before-define": ["off"],
"no-shadow": "off",
curly: ["error", "all"],
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false }],
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
"@typescript-eslint/no-shadow": [
"error",
{
builtinGlobals: true,
allow: ["location", "event", "history", "name", "status", "Option", "test", "expect"],
},
],
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
},
};