Repository navigation
Expand file tree
/
Copy pathbrowser.js
More file actions
119 lines (115 loc) · 3 KB
/
Copy pathbrowser.js
File metadata and controls
119 lines (115 loc) · 3 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import { claudeCodePlugin } from './plugins/claude-code/index.js';
import { hsWebTeamPlugin } from './plugins/hs-web-team/index.js';
import { underscoreDangleAllowlist, browserBaseRules as baseRules, browserGlobals } from './base-rules.js';
export { underscoreDangleAllowlist };
// React-specific rules
const reactRules = {
'react/prefer-stateless-function': 'off',
'react/no-array-index-key': 0,
'react/destructuring-assignment': 0,
'react/require-default-props': 0,
'react/self-closing-comp': [
2,
{
component: true,
html: false,
},
],
'react/forbid-prop-types': 0,
};
// Common ignore patterns
const commonIgnores = ['**/node_modules/**', '**/dist/**', '**/build/**', '**/.next/**', '**/coverage/**'];
export default [
// Global ignores
{
ignores: commonIgnores,
},
// Base recommended rules — scoped to JS/TS so they never run against
// non-JS languages (e.g. the markdown used for CLAUDE.md below).
{ ...js.configs.recommended, files: ['**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'] },
{
files: ['**/*.{js,mjs,cjs,jsx}'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: browserGlobals,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
...baseRules,
},
},
// React configuration
{
files: ['**/*.{js,mjs,cjs,jsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
...reactRules,
},
},
hsWebTeamPlugin.configs.recommended,
// TypeScript config
...tseslint.configs.recommended.map(config => ({
...config,
files: ['**/*.{ts,mts,cts,tsx}'],
})),
{
files: ['**/*.{ts,mts,cts,tsx}'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: browserGlobals,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
...baseRules,
},
},
// React configuration for TypeScript files
{
files: ['**/*.{ts,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
...reactRules,
},
},
// CLAUDE.md and SKILL.md context-file checks (see plugins/claude-code)
...claudeCodePlugin.configs.recommended,
];