-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
124 lines (118 loc) · 3.67 KB
/
eslint.config.js
File metadata and controls
124 lines (118 loc) · 3.67 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tailwind from 'eslint-plugin-tailwindcss';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['dist/**', 'types/**', '.venv/**', 'node_modules/**'],
},
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.strict,
...tailwind.configs['flat/recommended'],
eslintConfigPrettier,
{
files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react: react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'jsx-a11y': jsxA11y,
import: importPlugin,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
tailwindcss: {
callees: ['classnames', 'clsx', 'ctl', 'cn'],
config: 'tailwind.config.js',
},
},
rules: {
// React rules
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
'react/prop-types': 'off', // Using TypeScript for prop validation
'react/no-unescaped-entities': 'warn', // Relaxed for pre-commit
'react/no-unknown-property': 'warn', // Relaxed for pre-commit
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
// Accessibility rules
...jsxA11y.configs.recommended.rules,
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/iframe-has-title': 'error',
// Import rules
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/no-duplicates': 'error',
// TypeScript rules
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
// General rules
'no-unused-vars': 'off',
'no-console': 'off', // Disabled for development - can be enabled for production builds
'no-undef': 'error',
'prefer-const': 'error',
'no-var': 'error',
// Tailwind CSS rules
'tailwindcss/classnames-order': 'off', // Prettier handles ordering
'tailwindcss/no-custom-classname': 'off', // Disabled - we use FontAwesome and custom utilities
'tailwindcss/migration-from-tailwind-2': 'off', // Both syntaxes work fine in v3
},
}
);