-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
147 lines (142 loc) · 4.13 KB
/
Copy patheslint.config.mjs
File metadata and controls
147 lines (142 loc) · 4.13 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { defineConfig } from "eslint/config"
import js from "@eslint/js"
import globals from "globals"
import svelte from "eslint-plugin-svelte"
import typescriptEslint from "@typescript-eslint/eslint-plugin"
import tsParser from "@typescript-eslint/parser"
export default defineConfig([
// Base ignores for generated and intentionally skipped files.
{
ignores: [
"*.js",
".netlify/**",
"functions/**/*.js",
"dist/**/*.js",
"src/policy.ts",
],
},
// Shared repo defaults.
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
// Cypress specs run with browser, Mocha, Chai, and Cypress globals.
{
files: ["cypress/**/*.js"],
languageOptions: {
globals: {
...globals.browser,
...globals.mocha,
...globals.chai,
Cypress: false,
cy: false,
},
},
},
// Svelte base rules and TS-in-Svelte parsing.
...svelte.configs.base,
{
files: ["src/**/*.svelte"],
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parserOptions: {
extraFileExtensions: [".svelte"],
parser: tsParser,
},
},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^(state|_.*)$",
},
],
},
},
// TypeScript rules for repo source files.
{
files: ["src/**/*.ts"],
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
"constructor-super": "off",
"getter-return": "off",
"no-array-constructor": "off",
"no-class-assign": "off",
"no-const-assign": "off",
"no-dupe-args": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-new-native-nonconstructor": "off",
"no-new-symbol": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-setter-return": "off",
"no-this-before-super": "off",
"no-undef": "off",
"no-unreachable": "off",
"no-unsafe-negation": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"no-var": "error",
"no-with": "off",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": "error",
"no-async-promise-executor": "warn",
"no-console": [
"error",
{
allow: ["error", "info", "trace", "warn"],
},
],
"no-fallthrough": "off",
semi: ["error", "never"],
},
},
])