-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
108 lines (105 loc) · 3.75 KB
/
Copy patheslint.config.mjs
File metadata and controls
108 lines (105 loc) · 3.75 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
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from 'eslint-plugin-storybook';
import reactHooks from 'eslint-plugin-react-hooks';
import { createRequire } from 'node:module';
// @ts-check
import tseslint from 'typescript-eslint';
// Local rules — see tools/eslint-rules/. NORTH_STAR DT-14 governs dogfooding policy.
const requireLocal = createRequire(import.meta.url);
const holoscriptPlugin = {
rules: {
'no-regex-hs-parsing': requireLocal('./tools/eslint-rules/no-regex-hs-parsing.cjs'),
'no-raw-tailwind-color': requireLocal('./tools/eslint-rules/no-raw-tailwind-color.cjs'),
},
};
export default tseslint.config(
// Global ignores (replaces .eslintignore)
{
ignores: [
'packages/benchmark/**',
'packages/vscode-extension/**',
'.claude/**',
'**/dist/**',
'**/node_modules/**',
'**/.next/**',
'**/*.d.ts',
'**/*.js',
'**/__tests__/**',
'**/*.test.ts',
],
}, // Base config for all TypeScript files
tseslint.configs.recommended,
{
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
languageOptions: {
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'no-case-declarations': 'off',
'no-fallthrough': 'off',
'prefer-const': 'warn',
'no-useless-escape': 'off',
'no-constant-condition': 'off',
'no-empty': 'off',
'no-useless-catch': 'off',
'no-control-regex': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
},
},
storybook.configs['flat/recommended'],
// React hooks — only applies to .tsx files in studio
{
files: ['packages/studio/**/*.tsx', 'packages/studio/**/*.ts'],
plugins: { 'react-hooks': reactHooks },
rules: {
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
},
},
// HoloScript dogfooding — NORTH_STAR DT-14. Block regex-based HS parsing
// outside @holoscript/core. Rule self-exempts packages/core/**, __tests__/**,
// and tools/eslint-rules/** (see tools/eslint-rules/no-regex-hs-parsing.cjs).
// TODO(task_1776816202153_ss3v-followup): demoted to warn during CI unblock.
// 117 violations across 61 files need systematic migration to HoloCompositionParser.
{
plugins: { holoscript: holoscriptPlugin },
rules: {
'holoscript/no-regex-hs-parsing': 'warn',
},
},
// Studio design-system constraint — research/2026-07-07_taste-audit-agent-ui-ux.md (W.701).
// studio-* tokens exist (packages/studio/tailwind.config.js) but dashboards decayed to raw
// gray-*/slate-*/zinc-* because the system was a label, not a constraint. This makes it a
// checkable minimum. 'warn' initially (matches no-regex-hs-parsing precedent — surface the
// existing debt without breaking CI).
{
files: ['packages/studio/**/*.tsx', 'packages/studio/**/*.ts'],
plugins: { holoscript: holoscriptPlugin },
rules: {
'holoscript/no-raw-tailwind-color': 'warn',
},
}
);