Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) · 2.07 KB
/
Copy patheslint.config.js
File metadata and controls
64 lines (63 loc) · 2.07 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
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
// Build output, test artifacts, deps — plus the vendored Nayuki QR
// generator, which is preserved byte-for-byte upstream style.
ignores: [
'dist',
'**/dist',
'test-results',
'node_modules',
'lib/components/QRCode/qrcodegen.ts',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
},
languageOptions: {
globals: { ...globals.browser },
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
...reactHooks.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
// Repo-wide pre-existing debt under the two new plugins surfaces as
// warnings until each component is cleaned; new and edited code must
// still be warning-free (verify with: npx eslint <files>).
'react-hooks/refs': 'warn',
'react-hooks/purity': 'warn',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/use-memo': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
'jsx-a11y/interactive-supports-focus': 'warn',
'jsx-a11y/no-redundant-roles': 'warn',
'jsx-a11y/tabindex-no-positive': 'warn',
'jsx-a11y/no-noninteractive-tabindex': 'warn',
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
'jsx-a11y/no-autofocus': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
},
},
{
// Node tooling scripts (extract-palettes, etc.)
files: ['**/*.mjs'],
languageOptions: {
globals: { ...globals.node },
},
}
);