-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy patheslint.config.mjs
66 lines (65 loc) · 1.57 KB
/
eslint.config.mjs
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
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
import tsdoceslint from "eslint-plugin-tsdoc";
import globals from 'globals';
export default tseslint.config(
{
// Do not lint build outputs
ignores: [
"node_modules/",
"website/",
"examples/",
"packages/**/lib/",
"packages/**/dist/",
"packages/**/node_modules/",
],
},
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
],
plugins: {
"@typescript-eslint": tseslint.plugin,
tsdoc: tsdoceslint,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: ['./tsconfig.lint.json'],
},
globals: {
...globals.jest,
...globals.browser,
...globals.node
}
},
rules: {
"tsdoc/syntax": "warn",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
},
],
"@typescript-eslint/no-non-null-assertion": ["warn"],
"@typescript-eslint/no-unused-vars": [
"error",
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_" },
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
],
},
},
eslintPluginPrettier,
);