-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
111 lines (109 loc) · 2.41 KB
/
Copy patheslint.config.js
File metadata and controls
111 lines (109 loc) · 2.41 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
import js from '@eslint/js'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import tseslint from 'typescript-eslint'
import prettier from 'eslint-config-prettier'
import globals from 'globals'
// Common React Three Fiber (R3F) and Three.js declarative properties
const R3F_PROPERTIES = [
'position',
'rotation',
'scale',
'args',
'map',
'transparent',
'toneMapped',
'roughness',
'metalness',
'emissive',
'emissiveIntensity',
'depthWrite',
'frustumCulled',
'fog',
'intensity',
'distance',
'decay',
'geometry',
'material',
'attach',
'visible',
'castShadow',
'receiveShadow',
'renderOrder',
'object',
'blending',
'side',
]
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
plugins: {
'react-hooks': reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
},
},
// React Compiler experimental rules (includes immutability, purity, refs, set-state-in-effect, etc.)
reactHooks.configs.flat['recommended-latest'],
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
ecmaVersion: 'esnext',
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
...globals.es2024,
},
},
settings: {
react: { version: '19.2' },
},
rules: {
// Handled at compile time by TypeScript
'react/prop-types': 'off',
// Strict standard DOM attribute validation
'react/no-unknown-property': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
{
// Allow React Three Fiber declarative 3D properties only in 3D scene files
files: ['src/scene/**/*.tsx'],
rules: {
'react/no-unknown-property': ['error', { ignore: R3F_PROPERTIES }],
},
},
prettier,
{
ignores: [
'dist/',
'node_modules/',
'.vite/',
'*.config.*',
'scripts/',
'e2e/',
'.features-gen/',
'*.mjs',
'_*.mjs',
'public/',
'archive/',
'blend/',
'docs/',
'multi-resume-kit/',
'oss-contribution-tracker/',
'threejs-skills/',
'src/data/*.generated.ts',
],
}
)