-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy patheslint.config.js
More file actions
83 lines (74 loc) · 2.72 KB
/
eslint.config.js
File metadata and controls
83 lines (74 loc) · 2.72 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
import globals from "globals";
import tseslint from "typescript-eslint";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import eslintConfigPrettier from "eslint-config-prettier";
export default tseslint.config(
{ ignores: ["dist", "src/externals/sl-web-ogg"] },
{
extends: [
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
eslintPluginUnicorn.configs.recommended,
eslintConfigPrettier
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
globals: globals.browser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/no-deprecated": "error",
"capitalized-comments": [
"error",
"always",
{
ignorePattern: "noinspection|prettier"
}
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false
}
],
// Spessasynth uses snake_case
"unicorn/filename-case": [
"error",
{
cases: {
snakeCase: true
}
}
],
// Often used for new Array<type>, more cluttered with Array.from
"unicorn/no-new-array": "off",
// Useful in events
"unicorn/no-null": "off",
// Technical stuff like "modulators" or "envelopes" not commonly used
// TODO add proper rules for this later
"unicorn/prevent-abbreviations": "off",
// Need to pass undefined as value sometimes (for example getGenerator)
"unicorn/no-useless-undefined": "off",
// I don't like for...of with entries
"unicorn/no-for-loop": "off",
// Not in the RMIDI world
"unicorn/text-encoding-identifier-case": "off",
// We're working with legacy formats here
"unicorn/prefer-code-point": "off",
// I don't like it
"unicorn/prefer-at": "off",
// Doesn't work with typed arrays
"unicorn/prefer-spread": "off",
// This breaks a ton of TypeScript things
"unicorn/prefer-global-this": "off",
// We are targeting ES2022
"unicorn/no-array-sort": "off"
}
}
);