-
Notifications
You must be signed in to change notification settings - Fork 22
/
eslint.config.js
42 lines (41 loc) · 1.12 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
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [
{
ignores: ["**/dist", "examples", "packages/e2e", "coverage"],
},
js.configs.recommended,
{
plugins: {
"@typescript-eslint": typescriptPlugin,
},
languageOptions: {
parser: tsParser,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
},
},
{
files: ["*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
// eslint-disable-next-line no-undef
tsconfigRootDir: process.cwd(),
project: [
"./tsconfig.json",
"./packages/*/tsconfig.json",
"./examples/*/tsconfig.json",
],
},
rules: {
...typescriptPlugin.configs["recommended-requiring-type-checking"].rules,
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/prefer-optional-chain": "error",
},
},
eslintConfigPrettier,
];