Type object
File match .jscpd.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/jscpd-configuration/latest.json
Source https://www.schemastore.org/jscpd.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

minLines integer

minimum size of code block in lines to check for duplication

Default: 5
maxLines integer

maximum size of source file in lines to check for duplication

Default: 1000
maxSize string | integer

maximum size of source file in bytes to check for duplication (e.g.,: 1kb, 1mb, 120kb)

Default: "100kb"
minTokens integer

minimum size of code block in tokens to check for duplication

Default: 50
threshold number

maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded

formatsExts Record<string, string[]>
Default:
{}
output string

path to directory for non-console reports

Default: "./report"
path string[]

paths that should be included in duplicate detection (default: [process.cwd()])

pattern string

glob pattern for files that should be included in duplicate detection (e.g., **/*.txt); only used to filter directories configured via path option

Default: "**/*"
ignorePattern string[]

ignore code blocks matching these regular expressions

Default:
[]
mode enum
Default: "mild"
Values: "mild" "strict" "weak"
ignore string[]

glob pattern for files that should be excluded from duplicate detection

Default:
[]
format format[]

list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md

store enum

store used to collect information about code (default: in-memory store); install @jscpd/leveldb-store and use leveldb for big repositories

Values: "leveldb" "redis"
reporters enum[]

a list of reporters to use to output information about duplication; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters

Default:
[
  "console"
]
blame boolean

get information about authors and dates of duplicated blocks from Git

Default: false
silent boolean

do not write duplicate detection progress and result to console

Default: false
verbose boolean

show full information during duplicate detection

Default: false
absolute boolean

use absolute paths in reports

Default: false
skipLocal boolean

skip duplicates within folders; just detect cross-folder duplicates

Default: false
ignoreCase boolean

ignore case of symbols in code (experimental)

Default: false
gitignore boolean

ignore all files from .gitignore file

Default: false
reportersOptions object
Default:
{}
1 nested properties
badge object
9 nested properties
path string

output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg'))

label string

badge subject text (URL-encoding needed for spaces or special characters)

Default: "Copy/Paste"
labelColor colorPreset | colorHex
status string

badge value text (URL-encoding needed for spaces or special characters, default: duplication %)

style enum

badge look: flat or classic

Default: "classic"
Values: "flat" "classic"
icon string

URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...)

iconWidth number

SVG width of icon to display in front of badge subject text; set this if icon is not square

Default: 13
scale number

size of badge relative to default of 1

Default: 1
exitCode integer

exit code to use when at least one duplicate code block is detected but threshold is not exceeded

Default: 0

Definitions

colorPreset enum
colorHex string
color colorPreset | colorHex
format enum