-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.mjs
More file actions
54 lines (47 loc) · 1.45 KB
/
eslint.config.mjs
File metadata and controls
54 lines (47 loc) · 1.45 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
// @ts-check
// ts type data
import eslint from "@eslint/js";
// plugins
import stylistic from "@stylistic/eslint-plugin";
import tseslint from "typescript-eslint";
import jsdoc from "eslint-plugin-jsdoc";
export default tseslint.config(
{
// ignored compiled and build configs
ignores: ["jest.config.js", "src/assets/**", "eslint.config.mjs"],
},
{
rules: {
// Add warnings for missing simicolons
semi: ["warn", "always"],
// allow await promises without checking return
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: false },
],
// plugins
// standardize qoute handling to use double and allow inner usuage
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
},
plugins: {
jsdoc,
"@stylistic": stylistic,
"@typescript-eslint": tseslint.plugin,
},
},
// parser is necessary for typed checking
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigDirName: import.meta.dirname,
},
},
},
// enable strict configuration
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// plugins
jsdoc.configs["flat/stylistic-typescript"],
);