Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) · 2.22 KB
/
Copy patheslint.config.js
File metadata and controls
64 lines (63 loc) · 2.22 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
// Flat config (ESLint 9). `bun run lint`. Counts by rule are reported in
// nothing is disabled inline.
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import mobx from 'eslint-plugin-mobx';
import globals from 'globals';
export default tseslint.config(
{
ignores: [
'dist/**',
'dist-register/**',
'node_modules/**',
'public/**',
'Data/**',
'Data-v097d/**',
// generated from OpenMU's packet XML - regenerate, never lint
'versions/shared/packets/*Packets.ts',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks, mobx },
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
rules: {
...reactHooks.configs.recommended.rules,
...mobx.configs.recommended.rules,
// Engine code passes `_`-prefixed unused args on purpose.
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
'prefer-const': 'warn',
'no-var': 'warn',
// MobX observables are mutated in place by design.
'mobx/missing-observer': 'warn',
'mobx/exhaustive-make-observable': 'off',
},
},
{
files: ['tools/**', 'proxy/**', 'versions/shared/packets/generate.ts', '*.config.{js,ts}'],
rules: { 'no-console': 'off' },
},
{
// An ECS system is a PascalCase factory, never a React component: the rule only misreads them.
files: ['src/ecs/systems/**'],
rules: { 'mobx/missing-observer': 'off' },
},
{
// Content loaders: a Vite glob in the client, a synchronous `require` under Bun (servers and tools),
// where there is no glob. See versions/shared/items/all.ts.
files: ['versions/shared/*/all.ts', 'tools/itemFiles.ts', 'tools/monsterFiles.ts'],
rules: { '@typescript-eslint/no-require-imports': 'off' },
}
);