-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
63 lines (57 loc) · 1.73 KB
/
eslint.config.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
// NOTE: @typescript-eslint hasn't caught up to the new eslint config format yet, so we have to use compatibility tooling
const { FlatCompat } = require("@eslint/eslintrc");
const ESLintJS = require("@eslint/js");
const ESLintTSParser = require("@typescript-eslint/parser");
const ESLintTSPlugin = require("@typescript-eslint/eslint-plugin");
const prettier = require("eslint-config-prettier");
const globals = require("globals");
const compat = new FlatCompat({ resolvePluginsRelativeTo: __dirname });
module.exports = [
// For all code
ESLintJS.configs.recommended,
...compat.extends("plugin:@typescript-eslint/recommended"),
{
"linterOptions": {
"reportUnusedDisableDirectives": "error"
}
},
{
"files": ["**/*.{ts,tsx}"],
"languageOptions": {
"parser": ESLintTSParser,
},
},
// For all back-end code
{
"files": ["libs/*/{src,tests}/**", "apps/*/{src,tests}/**"],
"languageOptions": {
"ecmaVersion": 2022,
"globals": {
...globals.commonjs,
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
},
"plugins": {
"@typescript-eslint": ESLintTSPlugin,
},
},
// For testing
{
"files": ["**/tests/**"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
}
},
// A few random adjustments for everything
{
"rules": {
// Typescript does this already
"@typescript-eslint/no-unused-vars": "off",
}
},
// All code will be prettified, so make sure this is at the end
prettier,
]