-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
77 lines (72 loc) · 2.39 KB
/
eslint.config.mjs
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
import antfu from '@antfu/eslint-config';
import nextPlugin from '@next/eslint-plugin-next';
import jestDom from 'eslint-plugin-jest-dom';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import playwright from 'eslint-plugin-playwright';
import tailwind from 'eslint-plugin-tailwindcss';
import testingLibrary from 'eslint-plugin-testing-library';
export default antfu(
{
react: true,
typescript: true,
lessOpinionated: true,
isInEditor: false,
stylistic: {
semi: true,
},
formatters: {
css: true,
},
ignores: [
'.azuredevops/**/*',
'migrations/**/*',
'next-env.d.ts',
'docs/**/*',
'public/**/*',
'src/assets/**/*',
],
},
...tailwind.configs['flat/recommended'],
jsxA11y.flatConfigs.recommended,
{
plugins: {
'@next/next': nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
},
},
{
files: ['**/*.test.ts?(x)'],
...testingLibrary.configs['flat/react'],
...jestDom.configs['flat/recommended'],
},
{
files: ['**/*.spec.ts', '**/*.e2e.ts'],
...playwright.configs['flat/recommended'],
},
{
rules: {
'antfu/no-top-level-await': 'off', // Allow top-level await
'style/spaced-comment': 'off', // Allow top-level await
'style/arrow-parens': 'off', // Allow top-level await
'perfectionist/sort-imports': 'off', // Allow top-level await
'perfectionist/sort-exports': 'off', // Allow top-level await
'style/quote-props': 'off', // Allow top-level await
'style/brace-style': ['error', '1tbs'], // Use the default brace style
'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
'tailwindcss/no-custom-classname': 'off',
'style/jsx-wrap-multilines': 'off',
'style/operator-linebreak': 'off',
'antfu/consistent-list-newline': 'off',
'style/multiline-ternary': 'off', // Allow multiline ternary
'style/jsx-one-expression-per-line': 'off',
'jsx-a11y/no-autofocus': 'off',
'style/jsx-curly-newline': 'off',
},
},
);