-
Notifications
You must be signed in to change notification settings - Fork 135
/
eslint.config.mjs
90 lines (85 loc) · 2.27 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// @ts-check
import googleappsscript from "eslint-plugin-googleappsscript"
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
import eslintPluginTsdoc from "eslint-plugin-tsdoc"
import globals from "globals"
import tseslint from "typescript-eslint"
export default tseslint.config(
// global ignores
{
ignores: [
"bak/",
"build/",
"docs/",
"dist/",
"gas/",
"node_modules/",
"*.bak*",
"**/*.bak*",
"./src/**/*.ts",
],
},
// applies to all ts files
{
name: "ts",
files: ["src/lib/**/*.ts"],
ignores: ["src/lib/**/*.spec.ts"],
// ignores: ["src/examples/**/*.ts"],
extends: [
// ...eslint.configs.recommended,
...tseslint.configs.recommended,
// ...tseslint.configs.recommendedTypeChecked,
//...tseslint.configs.strictTypeChecked,
eslintPluginPrettierRecommended,
],
plugins: {
"@typescript-eslint": tseslint.plugin,
"eslint-plugin-tsdoc": eslintPluginTsdoc,
// prettier: eslintPluginPrettierRecommended,
},
languageOptions: {
globals: {
...globals.es2015,
...globals.node,
...googleappsscript.environments.googleappsscript.globals,
...globals.jest,
},
parser: tseslint.parser,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-extraneous-class": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
},
},
// {
// ...eslint.configs.recommended,
// ...eslintPluginPrettierRecommended,
// name: "gas",
// files: ["./src/gas/**/*.js"],
// extends: [],
// languageOptions: {
// globals: {
// ...globals.es2015,
// ...googleappsscript.environments.googleappsscript.globals,
// },
// },
// rules: {},
// },
// global variables, applies to everything
// {
// languageOptions: {
// globals: {
// ...globals.es2015,
// ...globals.node,
// ...googleappsscript.environments.googleappsscript.globals,
// ...globals.jest,
// },
// },
// },
)