forked from Active-Matrix/proximity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
119 lines (112 loc) · 2.96 KB
/
eslint.config.js
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
import js from '@eslint/js';
import globals from 'globals';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
import typescript from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
export default [
// Base configurations
js.configs.recommended,
reactRecommended,
reactJsxRuntime,
...typescript.configs.recommended,
// Global ignores
{
ignores: [
'**/node_modules/*',
'**/dist/*',
'**/build/*',
'**/*.config.js',
'.turbo',
'.next',
'**/coverage/*',
'**/public/*'
]
},
// Configuration for JavaScript and TypeScript files
{
files: [
'packages/**/*.{js,jsx,ts,tsx}',
'**/*.{js,jsx,ts,tsx}'
],
plugins: {
import: importPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin
},
languageOptions: {
globals: {
...globals.browser,
...globals.node
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
},
settings: {
'import/resolver': {
typescript: {
project: ['./tsconfig.json']
}
},
react: {
version: 'detect'
}
},
rules: {
// TypeScript-specific rules
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'error',
// React specific rules
'react/jsx-filename-extension': [1, {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}],
'react/function-component-definition': [2, {
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function'
}],
'react/react-in-jsx-scope': 'off',
// Import and module rules
'import/extensions': 'off',
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
'**/*.test.{js,jsx,ts,tsx}',
'**/*.spec.{js,jsx,ts,tsx}',
'**/test/**/*.{js,jsx,ts,tsx}',
'**/tests/**/*.{js,jsx,ts,tsx}'
]
}],
// Accessibility rules
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton']
}
],
// Customizations
'max-len': ['error', {
code: 120,
tabWidth: 2,
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}],
'no-console': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
"react/prop-types": "off"
}
}
];