-
Notifications
You must be signed in to change notification settings - Fork 19
/
eslint.config.js
96 lines (90 loc) · 2.59 KB
/
eslint.config.js
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
import eslint from '@eslint/js';
import importX from 'eslint-plugin-import-x';
import { configs as litConfigs } from 'eslint-plugin-lit';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import { configs as wcConfigs } from 'eslint-plugin-wc';
import globals from 'globals';
import { config, configs as tsConfigs } from 'typescript-eslint';
export default config(
eslint.configs.recommended,
...tsConfigs.recommendedTypeChecked,
...tsConfigs.stylisticTypeChecked,
wcConfigs['flat/best-practice'],
litConfigs['flat/recommended'],
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
{
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'import-x/newline-after-import': 'error',
'import-x/no-deprecated': 'error',
'import-x/default': 'off',
'import-x/no-named-as-default-member': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'wc/guard-super-call': 'off',
'wc/no-method-prefixed-with-on': 'error',
'lit/lifecycle-super': 'error',
'lit/no-legacy-imports': 'error',
'lit/no-this-assign-in-render': 'error',
'lit/no-useless-template-literals': 'error',
'lit/no-value-attribute': 'error',
'lit/prefer-nothing': 'error',
eqeqeq: 'error',
},
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
fetch: true,
// ...globals.browser,
...globals.node,
},
},
plugins: {
'simple-import-sort': simpleImportSort,
},
settings: {
elementBaseClasses: ['LitElement', 'BaseElement'],
},
},
{
files: [
'*.js',
'*.config.{js,ts}',
'packages/*/*.{js,ts,mjs,mts}',
'tasks/*.js',
'packages/*/bin/*.js',
'packages/*/src/stories/**/*.ts',
'packages/*/.storybook/*.ts',
'packages/*/testResources/**/*',
],
...tsConfigs.disableTypeChecked,
},
{
// Test-specific rules
files: ['test/**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
{
ignores: [
'node_modules',
'packages/*/dist',
'dist',
'.stryker-tmp',
'packages/*/reports',
'test-results',
'playwright-report',
],
},
);