-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
91 lines (86 loc) · 2.71 KB
/
eslint.config.js
File metadata and controls
91 lines (86 loc) · 2.71 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
84
85
86
87
88
89
90
91
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from 'eslint-plugin-storybook';
import js from '@eslint/js';
import globals from 'globals';
import litA11y from 'eslint-plugin-lit-a11y';
import tseslint from 'typescript-eslint';
export default [js.configs.recommended, {
languageOptions: {
ecmaVersion: 2024,
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2024,
},
},
plugins: {
'lit-a11y': litA11y,
},
rules: {
// Code quality
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'error',
'prefer-const': 'error',
'no-var': 'error',
// Style consistency
eqeqeq: ['error', 'always'],
curly: ['error', 'multi-line'],
'no-throw-literal': 'error',
// Web Components best practices
'no-implicit-globals': 'error',
// Accessibility (DigiToegankelijk / WCAG 2.1 AA)
// All 26 lit-a11y rules enabled for comprehensive accessibility linting
'lit-a11y/accessible-name': 'error',
'lit-a11y/alt-text': 'error',
'lit-a11y/anchor-is-valid': 'error',
'lit-a11y/aria-activedescendant-has-tabindex': 'error',
'lit-a11y/aria-attr-valid-value': 'error',
'lit-a11y/aria-attrs': 'error',
'lit-a11y/aria-role': 'error',
'lit-a11y/aria-unsupported-elements': 'error',
'lit-a11y/autocomplete-valid': 'error',
'lit-a11y/click-events-have-key-events': 'error',
'lit-a11y/definition-list': 'error',
'lit-a11y/heading-hidden': 'error',
'lit-a11y/iframe-title': 'error',
'lit-a11y/img-redundant-alt': 'error',
'lit-a11y/list': 'error',
'lit-a11y/mouse-events-have-key-events': 'error',
'lit-a11y/no-access-key': 'error',
'lit-a11y/no-aria-slot': 'error',
'lit-a11y/no-autofocus': 'warn',
'lit-a11y/no-distracting-elements': 'error',
'lit-a11y/no-redundant-role': 'error',
'lit-a11y/obj-alt': 'error',
'lit-a11y/role-has-required-aria-attrs': 'error',
'lit-a11y/role-supports-aria-attr': 'error',
'lit-a11y/scope': 'error',
'lit-a11y/tabindex-no-positive': 'error',
'lit-a11y/valid-lang': 'error',
},
}, {
files: ['**/*.ts'],
languageOptions: {
parser: tseslint.parser,
},
plugins: {
'@typescript-eslint': tseslint.plugin,
},
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
}, {
// Ignore patterns
ignores: [
'dist/**',
'node_modules/**',
'storybook-static/**',
'.storybook/**',
'.claude/**',
'scripts/**',
'*.config.js',
],
}, ...storybook.configs["flat/recommended"]];