mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
chore(lint): bring .tsx files into the eslint, lefthook, and jscpd lanes
.tsx sources and specs were invisible to every lint surface: the eslint flat-config globs, the lefthook staged-file glob, and the jscpd clone scan all matched *.ts only. Widen the five eslint file groups (source, test, client-test, sonar, formatting), the pre-commit glob, and the jscpd format/pattern to cover .tsx. Existing .tsx files predate these lanes; follow-up commits on this PR clear the backlog they surface.
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
"minTokens": 60,
|
||||
"minLines": 6,
|
||||
"mode": "mild",
|
||||
"format": ["typescript"],
|
||||
"pattern": "**/*.ts",
|
||||
"format": ["typescript", "tsx"],
|
||||
"pattern": "**/*.{ts,tsx}",
|
||||
"ignore": ["**/tests/**", "**/tsdown.config.ts"],
|
||||
"ignorePattern": [
|
||||
"(?s)/\\* jscpd:ignore-start \\*/.*?/\\* jscpd:ignore-end \\*/"
|
||||
|
||||
@@ -27,7 +27,13 @@ export default tseslint.config(
|
||||
|
||||
// --- our packages: full strictness -------------------------------------
|
||||
{
|
||||
files: ['packages/*/*/src/**/*.ts', 'apps/*/src/**/*.ts', 'examples/**/*.ts', 'scripts/**/*.ts', 'website/**/*.ts'],
|
||||
files: [
|
||||
'packages/*/*/src/**/*.{ts,tsx}',
|
||||
'apps/*/src/**/*.{ts,tsx}',
|
||||
'examples/**/*.{ts,tsx}',
|
||||
'scripts/**/*.{ts,tsx}',
|
||||
'website/**/*.{ts,tsx}',
|
||||
],
|
||||
extends: [
|
||||
...tseslint.configs.strictTypeChecked,
|
||||
],
|
||||
@@ -80,7 +86,12 @@ export default tseslint.config(
|
||||
|
||||
// --- tests: same rules, minus the friction that fights test ergonomics --
|
||||
{
|
||||
files: ['packages/*/*/tests/**/*.ts', 'apps/*/tests/**/*.ts', 'examples/*/tests/**/*.ts', 'scripts/**/*.spec.ts'],
|
||||
files: [
|
||||
'packages/*/*/tests/**/*.{ts,tsx}',
|
||||
'apps/*/tests/**/*.{ts,tsx}',
|
||||
'examples/*/tests/**/*.{ts,tsx}',
|
||||
'scripts/**/*.spec.{ts,tsx}',
|
||||
],
|
||||
extends: [
|
||||
...tseslint.configs.strictTypeChecked,
|
||||
],
|
||||
@@ -117,7 +128,10 @@ export default tseslint.config(
|
||||
// Context merges collide), so the shared project service cannot resolve
|
||||
// them — parse these through the client aggregate explicitly.
|
||||
{
|
||||
files: ['packages/client/*/tests/**/*.ts', 'scripts/client-bundle-purity.spec.ts'],
|
||||
files: [
|
||||
'packages/client/*/tests/**/*.{ts,tsx}',
|
||||
'scripts/client-bundle-purity.spec.ts',
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: false,
|
||||
@@ -129,7 +143,7 @@ export default tseslint.config(
|
||||
|
||||
// --- file-local duplication (all owned TypeScript) ---------------------
|
||||
{
|
||||
files: ['packages/**/*.ts', 'apps/**/*.ts', 'examples/**/*.ts', 'scripts/**/*.ts', 'website/**/*.ts'],
|
||||
files: ['packages/**/*.{ts,tsx}', 'apps/**/*.{ts,tsx}', 'examples/**/*.{ts,tsx}', 'scripts/**/*.{ts,tsx}', 'website/**/*.{ts,tsx}'],
|
||||
plugins: { sonarjs },
|
||||
rules: {
|
||||
// Cross-file clones are covered separately by jscpd.
|
||||
@@ -146,7 +160,14 @@ export default tseslint.config(
|
||||
|
||||
// --- formatting (everything we own) -------------------------------------
|
||||
{
|
||||
files: ['packages/**/*.ts', 'apps/**/*.ts', 'examples/**/*.ts', 'scripts/**/*.ts', 'website/**/*.ts', 'eslint.config.mjs'],
|
||||
files: [
|
||||
'packages/**/*.{ts,tsx}',
|
||||
'apps/**/*.{ts,tsx}',
|
||||
'examples/**/*.{ts,tsx}',
|
||||
'scripts/**/*.{ts,tsx}',
|
||||
'website/**/*.{ts,tsx}',
|
||||
'eslint.config.mjs',
|
||||
],
|
||||
plugins: { '@stylistic': stylistic },
|
||||
rules: {
|
||||
'@stylistic/indent': ['error', 2],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
pre-commit:
|
||||
jobs:
|
||||
- name: lint (staged)
|
||||
glob: '*.{ts,mts,cts,mjs}'
|
||||
glob: '*.{ts,tsx,mts,cts,mjs}'
|
||||
exclude:
|
||||
- 'vendor/*/src/**'
|
||||
run: node_modules/.bin/eslint --fix {staged_files}
|
||||
|
||||
Reference in New Issue
Block a user