chore: gate TypeScript duplication in CI

This commit is contained in:
Tianyi Cui
2026-07-13 23:42:54 +08:00
parent 62eba83f4f
commit 661504b3ec
11 changed files with 244 additions and 71 deletions

View File

@@ -1,4 +1,5 @@
import stylistic from '@stylistic/eslint-plugin'
import sonarjs from 'eslint-plugin-sonarjs'
import tseslint from 'typescript-eslint'
/**
@@ -123,6 +124,17 @@ export default tseslint.config(
},
},
// --- file-local duplication (all owned TypeScript) ---------------------
{
files: ['packages/**/*.ts', 'examples/**/*.ts', 'scripts/**/*.ts'],
plugins: { sonarjs },
rules: {
// Cross-file clones are covered separately by jscpd.
'sonarjs/no-identical-functions': 'error',
'sonarjs/no-duplicated-branches': 'error',
},
},
// --- formatting (everything we own) -------------------------------------
{
files: ['packages/**/*.ts', 'examples/**/*.ts', 'scripts/**/*.ts', 'eslint.config.mjs'],