-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy patheslint.config.mjs
More file actions
82 lines (80 loc) · 2.29 KB
/
eslint.config.mjs
File metadata and controls
82 lines (80 loc) · 2.29 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
import antfu from '@antfu/eslint-config';
import jsxA11y from 'eslint-plugin-jsx-a11y';
export default antfu(
{
react: true,
astro: true,
typescript: true,
formatters: {
css: true,
html: true,
astro: 'prettier',
markdown: 'prettier',
svg: 'prettier',
},
stylistic: {
semi: true,
indent: 2,
quotes: 'single',
},
// Many are ignored by default.
// https://github.com/antfu/eslint-config/blob/main/src/globs.ts#L56
ignores: [
'**/CLAUDE.md',
'**/ARCHITECTURE.md',
'**/.astro/',
'**/.vercel/',
'**/dist/',
'**/styles/vjs.css',
// some files that make eslint/prettier panic
'site/src/components/Posthog.astro',
'site/src/components/ThemeInit.astro',
],
plugins: {
'jsx-a11y': jsxA11y,
},
rules: {
// Allow single line bracing.
'antfu/if-newline': 'off',
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
// Only quote props when necessary.
'style/quote-props': ['error', 'as-needed'],
// JSX A11Y plugin rules
...jsxA11y.configs.recommended.rules,
},
},
{
files: ['**/*.md'],
rules: {
'style/max-len': 'off',
},
},
{
files: ['**/*.md/**'],
rules: {
// Disable rules that conflict with documentation code examples in markdown
'ts/no-unsafe-function-type': 'off',
'ts/method-signature-style': 'off',
'node/handle-callback-err': 'off',
'react-refresh/only-export-components': 'off',
'react-dom/no-missing-button-type': 'off',
'react/no-array-index-key': 'off',
'react-hooks/rules-of-hooks': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'unused-imports/no-unused-vars': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'import/first': 'off',
'import/newline-after-import': 'off',
'unicorn/prefer-node-protocol': 'off',
'format/prettier': 'off',
'perfectionist/sort-named-imports': 'off',
'style/quotes': 'off',
'style/semi': 'off',
'style/member-delimiter-style': 'off',
'style/jsx-one-expression-per-line': 'off',
},
},
);