forked from coasys/we
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
83 lines (81 loc) · 2.63 KB
/
eslint.config.js
File metadata and controls
83 lines (81 loc) · 2.63 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 js from '@eslint/js';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import eslintConfigPrettier from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import prettierConfig from './.prettierrc.json' with { type: 'json' };
export default [
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/build/**',
'**/old/**',
'**/target/**',
'**/dist-electron/**',
'**/.storybook/**',
],
},
{
name: 'common/recommended',
plugins: { prettier: prettierPlugin },
rules: { ...prettierPlugin.configs.recommended.rules, 'prettier/prettier': ['error', prettierConfig] },
},
{
name: 'javascript/recommended',
files: ['**/*.js', '**/*.jsx'],
languageOptions: {
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
Buffer: 'readonly',
module: 'readonly',
require: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearTimeout: 'readonly',
clearInterval: 'readonly',
},
},
plugins: { 'simple-import-sort': simpleImportSortPlugin },
rules: {
...js.configs.recommended.rules,
'simple-import-sort/imports': 'error',
},
},
{
name: 'typescript/recommended',
files: ['**/*.ts', '**/*.tsx'],
plugins: { '@typescript-eslint': tsPlugin, 'simple-import-sort': simpleImportSortPlugin },
languageOptions: {
parser: tsParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
...tsPlugin.configs.recommended.rules,
'simple-import-sort/imports': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// Turn off any rules that conflict with prettier
eslintConfigPrettier,
{
// Declaration merging (interface + class) is the approved pattern for
// adding HasManyMethods types to Ad4mModel subclasses without triggering
// Babel's declare-field ordering issues. The interface body is intentionally
// empty — it inherits all members from HasManyMethods<Keys>.
name: 'ad4m-models/declaration-merging',
files: ['**/models/**/*.ts', '**/src/block-types/**/*.ts'],
rules: {
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
];