-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy patheslint.config.mjs
More file actions
75 lines (69 loc) 路 2.25 KB
/
Copy patheslint.config.mjs
File metadata and controls
75 lines (69 loc) 路 2.25 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
import antfu from '@antfu/eslint-config';
import eslintPluginBetterTailwindcss from 'eslint-plugin-better-tailwindcss';
import playwright from 'eslint-plugin-playwright';
import storybook from 'eslint-plugin-storybook';
export default antfu(
{
react: true,
nextjs: true,
typescript: true,
// Configuration preferences
lessOpinionated: true,
isInEditor: false,
// Code style
stylistic: {
semi: true,
},
// Format settings
formatters: {
/**
* Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
* By default uses Prettier
*/
css: true,
},
// Ignored paths
ignores: [
'.alchemy/**/*',
'migrations/**/*',
// explicitly allow .claude
'!.claude/',
],
},
// --- Tailwind CSS Rules ---
eslintPluginBetterTailwindcss.configs.recommended,
{
settings: {
'better-tailwindcss': {
// tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
entryPoint: 'src/styles/global.css',
},
},
},
// --- E2E Testing Rules ---
{
files: [
'**/*.integ.ts',
'**/*.e2e.ts',
],
...playwright.configs['flat/recommended'],
},
// --- Storybook Rules ---
...storybook.configs['flat/recommended'],
// --- Custom Rule Overrides ---
{
rules: {
'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/purity': 'off', // Allow intentional impure render logic when needed
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
'react/exhaustive-deps': 'off', // Disable exhaustive-deps in useEffect
'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
'jsdoc/require-jsdoc': 'off', // JSDoc comments are optional
'jsdoc/require-returns': 'off', // Return types are optional
},
},
);