-
Notifications
You must be signed in to change notification settings - Fork 118
/
eslint.config.mjs
112 lines (94 loc) · 3.13 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// This is the configuration file for ESLint, the TypeScript linter:
// https://eslint.org/docs/latest/use/configure/
// @ts-check
import {
completeConfigBase,
completeConfigMonorepo,
} from "eslint-config-complete";
import tseslint from "typescript-eslint";
export const hanabiConfigBase = tseslint.config(
...completeConfigBase,
...completeConfigMonorepo,
{
rules: {
// Insert changed or disabled rules here, if necessary.
// @template-customization-start
/**
* Documentation:
* https://eslint.org/docs/latest/rules/func-style
*
* Enforce the "normal" function style throughout the entire project.
*/
"func-style": ["error", "declaration"],
/**
* Documentation:
* https://typescript-eslint.io/rules/prefer-enum-initializers/
*
* We use number enums to save bandwidth between client and server. Number enums are almost
* always safe with the `complete/strict-enums` rule.
*/
"@typescript-eslint/prefer-enum-initializers": "off",
/**
* Documentation:
* TODO
*
* We use number enums to save bandwidth between client and server. Number enums are almost
* always safe with the `isaacscript/strict-enums` rule.
*/
"complete/no-number-enums": "off",
/**
* Documentation:
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
*
* We need to whitelist the monorepo packages.
*/
"import-x/no-extraneous-dependencies": [
"warn",
{
whitelist: [
"@hanabi-live/data",
"@hanabi-live/game",
"eslint-config-complete",
"typescript-eslint",
],
},
],
// BEGIN ESM EXCEPTIONS
/**
* Documentation:
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/file-extension-in-import.md
*
* Keep this rule disabled until the project can be moved to ESM (which is contingent upon the
* dependencies being up to date).
*/
"n/file-extension-in-import": "off",
/**
* Documentation:
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
*
* Keep this rule disabled until the project can be moved to ESM (which is contingent upon the
* dependencies being up to date).
*/
"unicorn/prefer-module": "off",
/**
* Documentation:
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md
*
* Keep this rule disabled until the project can be moved to ESM (which is contingent upon the
* dependencies being up to date).
*/
"unicorn/prefer-top-level-await": "off",
// END ESM EXCEPTIONS
// @template-customization-end
},
},
// @template-customization-start
{
ignores: [
"packages/data/src/version.js",
"packages/game/docs/assets/main.js",
],
},
// @template-customization-end
);
export default tseslint.config(...hanabiConfigBase);