-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy patheslint.config.mjs
More file actions
50 lines (46 loc) · 1.43 KB
/
eslint.config.mjs
File metadata and controls
50 lines (46 loc) · 1.43 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
import antfu from '@antfu/eslint-config';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import playwright from 'eslint-plugin-playwright';
export default antfu(
{
react: true,
nextjs: true,
typescript: {
tsconfigPath: 'tsconfig.json',
},
// Configuration preferences
lessOpinionated: true,
isInEditor: false,
// Code style
stylistic: {
semi: true,
},
// Format settings
formatters: {
css: true,
},
},
// --- Accessibility Rules ---
jsxA11y.flatConfigs.recommended,
// --- E2E Testing Rules ---
{
files: [
'**/*.spec.ts',
'**/*.e2e.ts',
],
...playwright.configs['flat/recommended'],
},
// --- Custom Rule Overrides ---
{
rules: {
'react/no-implicit-key': 'off', // Fixes linting errors on configuration files
'antfu/no-top-level-await': 'off', // Allow top-level await
'style/brace-style': ['error', '1tbs'], // Use the default brace style
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface`
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
'node/prefer-global/process': 'off', // Allow using `process.env`
'test/padding-around-all': 'error', // Add padding in test files
'test/prefer-lowercase-title': 'off', // Allow using uppercase titles in test titles
},
},
);