-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.js
More file actions
110 lines (91 loc) · 2.77 KB
/
eslint.config.js
File metadata and controls
110 lines (91 loc) · 2.77 KB
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
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-require-imports */
const {
fixupConfigRules,
fixupPluginRules,
} = require("@eslint/compat");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const tsParser = require("@typescript-eslint/parser");
const js = require("@eslint/js");
const unusedImports = require("eslint-plugin-unused-imports");
const {
FlatCompat,
} = require("@eslint/eslintrc");
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
module.exports = [{
ignores: [
"**/out",
"**/dist",
"**/node_modules",
"src/solar-search/graphql/client",
"**/*.vsix"
],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
)), {
plugins: {
"@typescript-eslint": fixupPluginRules(typescriptEslint),
"unused-imports": unusedImports,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 6,
sourceType: "module",
parserOptions: {
project: ["./tsconfig.json", "./scripts/tsconfig.json", "./api/tsconfig.json"],
},
globals: {
process: "readonly",
},
},
files: ["**/*.ts", "**/*.tsx"],
settings: {
react: {
version: "detect",
},
},
rules: {
"@typescript-eslint/no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
}],
"@typescript-eslint/no-this-alias": ["off"],
"@typescript-eslint/prefer-readonly": ["error"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {
allowSingleLine: true,
}],
"eol-last": ["error"],
indent: ["error", 4, {
SwitchCase: 1,
}],
"linebreak-style": ["error", "unix"],
"no-constant-condition": ["error", {
checkLoops: false,
}],
"no-redeclare": "off",
"no-trailing-spaces": ["error"],
"object-curly-spacing": ["error", "always"],
quotes: ["error", "single", {
avoidEscape: true,
}],
semi: ["error", "always"],
"space-in-parens": "error",
"space-before-blocks": "error",
"keyword-spacing": "error",
"space-infix-ops": "error",
"react/prop-types": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
],
},
}];