build: Add jscpd config for local and CI duplication scans (#39198)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Emilia 2026-10-07 07:37:00 +00:00 committed by GitHub
parent e882e8a483
commit e500386a54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 116 additions and 0 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ dist
coverage
coverage-by-spec
coverage-by-spec-backend
/report
npm-debug.log*
yarn.lock
google-generated-credentials.json

26
.jscpd.json Normal file
View File

@ -0,0 +1,26 @@
{
"threshold": 10.5,
"reporters": ["json", "html"],
"gitignore": true,
"ignore": [
"**/__snapshots__/**",
"**/*.snap",
"**/fixtures/**",
"**/locales/**",
"**/i18n/**",
"**/*.generated.*",
"**/__schema__/**",
"**/cassettes/**",
"packages/@n8n/typeorm/test/**",
"docs/generated/**",
"**/test/**/*.workflow.json",
"**/tests/**/*.workflow.json",
"**/__tests__/**/*.workflow.json",
"**/test/**/workflow.*.json",
"**/tests/**/workflow.*.json",
"**/__tests__/**/workflow.*.json",
"**/test/**/workflows/**/*.json",
"**/tests/**/workflows/**/*.json",
"**/__tests__/**/workflows/**/*.json"
]
}

View File

@ -58,6 +58,7 @@
"profile:ci-tests": "node scripts/ci-test-phase-profile.mjs",
"test:inventory": "node scripts/test-inventory.mjs",
"format:check": "turbo run format:check",
"jscpd": "jscpd",
"lint": "turbo run lint",
"lint:styles": "turbo run lint:styles",
"lint:styles:fix": "turbo run lint:styles:fix",
@ -111,6 +112,7 @@
"@types/supertest": "^6.0.3",
"cross-env": "^7.0.3",
"eslint": "catalog:",
"jscpd": "5.2.0",
"knip": "catalog:",
"lefthook": "^1.13.6",
"nodemon": "^3.0.1",

View File

@ -1117,6 +1117,9 @@ importers:
eslint:
specifier: 'catalog:'
version: 9.29.0(jiti@2.6.1)(supports-color@5.5.0)
jscpd:
specifier: 5.2.0
version: 5.2.0
knip:
specifier: 'catalog:'
version: 6.35.1
@ -19683,6 +19686,55 @@ packages:
jsbn@1.1.0:
resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
jscpd-darwin-arm64@5.2.0:
resolution: {integrity: sha512-QnEDfTH2MymizVHiEQpqfYEj63k1DW7QC0QBZoevh+o/iHQrHxKlgrakMysUIwIJlnmvqPB6iP/G3dBpFmnmeQ==}
cpu: [arm64]
os: [darwin]
jscpd-darwin-x64@5.2.0:
resolution: {integrity: sha512-P2lYEK0Yyn+0z7618+9A0NErywjaPrwSYcId3gRSt5l0cyKBwhMmyFLX/2t3G2HRi+GX+OT2A/YpWvvTzLJJ1A==}
cpu: [x64]
os: [darwin]
jscpd-linux-arm64-gnu@5.2.0:
resolution: {integrity: sha512-UhdX9vvCFwoG1cViNqFyvxfqNtJ+xWbGsgZ5PbcgUx2OLWnvjhkjihPw/fOUM9IoxHaT66AE5pipaV/oQE/76A==}
cpu: [arm64]
os: [linux]
libc: [glibc]
jscpd-linux-arm64-musl@5.2.0:
resolution: {integrity: sha512-13DsZCQ58fOMUX6mU8DZtiTdIk+9Gp2xLu6mtc6fmqqZRJoRHQSSDvMqRVedCqArquxc0I+tqQtZO4n7/8QJxA==}
cpu: [arm64]
os: [linux]
libc: [musl]
jscpd-linux-x64-gnu@5.2.0:
resolution: {integrity: sha512-p88BpA5QzyZzyF8uYeVCz9ZBoZYg8s6AwcDc3NkIDNTbrrF0sKqgGjclGWAoJvYAiGExiFNqV768pVHsE//l0Q==}
cpu: [x64]
os: [linux]
libc: [glibc]
jscpd-linux-x64-musl@5.2.0:
resolution: {integrity: sha512-6DgIxJpS7L4bb1DkYrqC0SflMY2/2/3Dl0kZJ1In6SeSENcTaZ12W1zX3kNf7wVUDFgPi94TuSxrw3N2TqRhRg==}
cpu: [x64]
os: [linux]
libc: [musl]
jscpd-windows-arm64-msvc@5.2.0:
resolution: {integrity: sha512-DI84oCG+L5sYhmYanXjjydXlFzC194/NJA6F7W8cmOI1rKSnWrgIjUtvTmXumygwTK/eAXkK7rFBqFnyiLEzdw==}
cpu: [arm64]
os: [win32]
jscpd-windows-x64-msvc@5.2.0:
resolution: {integrity: sha512-EH4chck2EIehosfy7q6hxaKgzlaZv/dZhUHtjBmBf81d5/ZDfa6BsKw2gM8PSoNC0QXznWXv9uQcFWsV+P9v8A==}
cpu: [x64]
os: [win32]
jscpd@5.2.0:
resolution: {integrity: sha512-6f4qhJGIeR/ZvAkZByfpPw5H28SNEE4fgJ4GXxVuLMiEg7xWrAlUdm0crIJPY6dmykvgdM83ZRrWJXg11fQlYg==}
engines: {node: '>=18'}
hasBin: true
jsdom@23.0.1:
resolution: {integrity: sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==}
engines: {node: '>=18'}
@ -38687,6 +38739,41 @@ snapshots:
jsbn@1.1.0:
optional: true
jscpd-darwin-arm64@5.2.0:
optional: true
jscpd-darwin-x64@5.2.0:
optional: true
jscpd-linux-arm64-gnu@5.2.0:
optional: true
jscpd-linux-arm64-musl@5.2.0:
optional: true
jscpd-linux-x64-gnu@5.2.0:
optional: true
jscpd-linux-x64-musl@5.2.0:
optional: true
jscpd-windows-arm64-msvc@5.2.0:
optional: true
jscpd-windows-x64-msvc@5.2.0:
optional: true
jscpd@5.2.0:
optionalDependencies:
jscpd-darwin-arm64: 5.2.0
jscpd-darwin-x64: 5.2.0
jscpd-linux-arm64-gnu: 5.2.0
jscpd-linux-arm64-musl: 5.2.0
jscpd-linux-x64-gnu: 5.2.0
jscpd-linux-x64-musl: 5.2.0
jscpd-windows-arm64-msvc: 5.2.0
jscpd-windows-x64-msvc: 5.2.0
jsdom@23.0.1(bufferutil@4.0.9)(supports-color@5.5.0)(utf-8-validate@5.0.10):
dependencies:
cssstyle: 3.0.0