Getting Started

Supported Formats

Languages and formats supported by jscpd.

Overview

jscpd supports 223 programming languages and document formats for duplication detection.

130 formats are auto-detected by file extension. 88 registered formats have a grammar but no built-in extension mapping — use --formats-exts or --formats-names to activate them. An additional 5 formats (clike, comments, hpkp, hsts, keymap) are internal grammar dependencies.

Cross-Format Tokenizers

These formats use bespoke multi-block tokenizers that extract embedded code sections and resolve each block to the correct sub-format, enabling cross-format duplicate detection — e.g. a <script> block in a .vue file matched against .ts files.

FormatExtensionsDescription
astro.astroAstro component format (frontmatter + template)
svelte.svelteSvelte reactive component framework
vue.vueVue Single-File Component (template, script, style blocks)
markdown.md, .markdown, .mkdMarkdown with fenced code blocks tokenized by language

Auto-Detected Formats

These formats are detected automatically by file extension — no extra flags needed.

General-Purpose Languages

FormatExtensionsDescription
actionscript.asAdobe ActionScript
ada.adaAda, strongly-typed systems language
antlr4.g4ANTLR v4 grammar definitions
apex.cls, .trigger, .apexSalesforce Apex
apl.aplAPL, array-oriented language
aspnet.asp, .aspxASP.NET server-side files
awk.awkAWK text-processing
bash.sh, .ksh, .bashBash and POSIX shell scripts
basic.basBASIC
bicep.bicepAzure Bicep infrastructure-as-code
brainfuck.b, .bfBrainfuck esoteric language
c.c, .z80C programming language
c-header.hC header files
cfml.cfmColdFusion Markup Language
cfscript.cfcColdFusion components (CFScript)
clojure.clj, .cljs, .cljc, .cljx, .ednClojure
cmake.cmakeCMake build scripts
coffeescript.coffeeCoffeeScript
cpp.cpp, .c++, .cc, .cxxC++
cpp-header.hpp, .h++, .hh, .hxxC++ header files
crystal.crCrystal
csharp.csC#
csv.csvCSV data files
css.css, .gssCSS
d.dD systems language
dart.dartDart / Flutter
diff.diff, .patchUnified diff and patch files
dot.dot, .gvGraphviz DOT
eiffel.eEiffel
elm.elmElm web language
erlang.erl, .erlangErlang
excel-formula.xlsx, .xlsMicrosoft Excel
fortran.f, .for, .f77, .f90Fortran
fsharp.fsF#
gdscript.gdGDScript for Godot
gettext.poGNU gettext PO files
gherkin.featureGherkin BDD scenarios
go.goGo
graphql.graphqlGraphQL
groovy.groovy, .gradleGroovy / Gradle
haml.hamlHaml templates
handlebars.hb, .hbs, .handlebarsHandlebars templates
haskell.hs, .lhsHaskell
haxe.hx, .hxmlHaxe
hcl.tf, .hclHashiCorp HCL (Terraform)
idris.idrIdris
ignore.gitignoreGitignore files
ini.iniINI configuration
java.javaJava
javascript.js, .es, .es6, .mjs, .cjsJavaScript
json.json, .map, .jsonldJSON
json5.json5JSON5
jsx.jsxJSX (React)
julia.jlJulia
kotlin.kt, .ktsKotlin
latex.texLaTeX
less.lessLess CSS preprocessor
lilypond.lyLilyPond music notation
linker-script.ldGNU linker scripts
lisp.cl, .lisp, .elCommon Lisp / Emacs Lisp
livescript.lsLiveScript
llvm.llLLVM IR
log.logLog files
lua.luaLua
markup.html, .htm, .xml, .xsl, .xslt, .svg, .ejs, .jspHTML, XML, SVG
nsis.nsh, .nsiNSIS installer scripts
objectivec.m, .mmObjective-C
ocaml.ocaml, .ml, .mli, .mll, .mlyOCaml
openqasm.qasmOpenQASM quantum assembly
oz.ozOz/Mozart
pascal.pas, .pPascal
perl.pl, .pmPerl
php.php, .phtmlPHP
plant-uml.puml, .plantumlPlantUML diagrams
plsql.plsqlPL/SQL
powerquery.pqPower Query M
powershell.ps1, .psd1, .psm1PowerShell
properties.propertiesJava properties
protobuf.protoProtocol Buffers
pug.pug, .jadePug (Jade) templates
puppet.pp, .puppetPuppet
purescript.pursPureScript
python.py, .pyx, .pxd, .pxiPython
q.qQ/kdb+
qsharp.qsQ# quantum
r.r, .RR
racket.rktRacket
rescript.resReScript
robotframework.robotRobot Framework
ruby.rbRuby
rust.rsRust
sas.sasSAS
sass.sassSass (indented syntax)
scala.scalaScala
scheme.scm, .ssScheme
scss.scssSCSS
smalltalk.stSmalltalk
smarty.smarty, .tplSmarty templates
solidity.solSolidity (Ethereum)
soy.soyGoogle Closure Templates
sparql.rqSPARQL
sql.sql, .cqlSQL
stylus.styl, .stylusStylus
swift.swiftSwift
tap.tapTAP (Test Anything Protocol)
tcl.tclTcl
textile.textileTextile markup
toml.tomlTOML configuration
tsx.tsxTSX (React + TypeScript)
tt2.tt2Template Toolkit 2
turtle.ttlTurtle (RDF)
twig.twigTwig templates
typescript.ts, .mts, .ctsTypeScript
txt.txtPlain text
unrealscript.ucUnrealScript
vbnet.vbVisual Basic .NET
velocity.vtlApache Velocity
verilog.vVerilog (hardware)
vhdl.vhd, .vhdlVHDL
wgsl.wgslWebGPU Shading Language
wolfram.wl, .nbWolfram Language
xquery.xy, .xqueryXQuery
yaml.yaml, .ymlYAML
zig.zigZig

Registered Formats (No Extension Mapping)

These formats have a working grammar but no built-in file extension mapping. Use --formats-exts to associate extensions, or --formats-names for extensionless files.

# Example: enable ABAP detection for .abap files
jscpd --formats-exts "abap:abap" ./src

# Example: detect Dockerfiles by name
jscpd --formats-names "docker:Dockerfile" ./src
FormatInstall command
abap--formats-exts "abap:abap"
apacheconf--formats-exts "apacheconf:conf"
applescript--formats-exts "applescript:applescript,scpt"
arduino--formats-exts "arduino:ino"
arff--formats-exts "arff:arff"
asciidoc--formats-exts "asciidoc:adoc,asciidoc"
asm6502--formats-exts "asm6502:s,asm"
autohotkey--formats-exts "autohotkey:ahk"
autoit--formats-exts "autoit:au3"
batch--formats-exts "batch:bat,cmd"
bison--formats-exts "bison:y,yy"
bro--formats-exts "bro:bro,zeek"
csp--formats-exts "csp:csp"
css-extras--formats-exts "css-extras:css"
django--formats-exts "django:html,djhtml"
docker--formats-names "docker:Dockerfile" or --formats-exts "docker:dockerfile"
elixir--formats-exts "elixir:ex,exs"
erb--formats-exts "erb:erb"
flow--formats-exts "flow:js"
gdscript--formats-exts "gdscript:gd" (also auto-detected by .gd)
gedcom--formats-exts "gedcom:ged"
git--formats-exts "git:gitconfig"
glsl--formats-exts "glsl:glsl,vert,frag"
http--formats-exts "http:http"
ichigojam--formats-exts "ichigojam:bas"
icon--formats-exts "icon:icn"
inform7--formats-exts "inform7:ni,i7x"
io--formats-exts "io:io"
j--formats-exts "j:ijs"
jolie--formats-exts "jolie:ol,iol"
liquid--formats-exts "liquid:liquid"
lolcode--formats-exts "lolcode:lol"
makefile--formats-names "makefile:Makefile,GNUmakefile"
matlab--formats-exts "matlab:m"
mel--formats-exts "mel:mel"
mizar--formats-exts "mizar:miz"
monkey--formats-exts "monkey:monkey"
n4js--formats-exts "n4js:n4js"
nasm--formats-exts "nasm:asm,nasm"
nginx--formats-exts "nginx:conf,nginx"
nim--formats-exts "nim:nim"
nix--formats-exts "nix:nix"
opencl--formats-exts "opencl:cl"
parigp--formats-exts "parigp:gp"
processing--formats-exts "processing:pde"
prolog--formats-exts "prolog:pl,pro"
promql--formats-exts "promql:promql"
pure--formats-exts "pure:pure"
qore--formats-exts "qore:q,qm"
reason--formats-exts "reason:re,rei"
renpy--formats-exts "renpy:rpy"
rest--formats-exts "rest:rst"
rip--formats-exts "rip:rip"
roboconf--formats-exts "roboconf:graph,instances"
vim--formats-exts "vim:vim"
wasm--formats-exts "wasm:wat"
wiki--formats-exts "wiki:wiki"
xeora--formats-exts "xeora:xeora,xchtml"
xojo--formats-exts "xojo:xojo_code,xojo_window"

Extension Detection Only (No Grammar)

These formats register file extensions for detection but have no bundled grammar — tokenization returns an empty array. They still benefit from jscpd's blank-line and structural matching.

FormatInstall command
abnf--formats-exts "abnf:abnf"
agda--formats-exts "agda:agda"
aql--formats-exts "aql:aql"
armasm--formats-exts "armasm:s,asm"
bnf--formats-exts "bnf:bnf"
cobol--formats-exts "cobol:cob,cbl"
cypher--formats-exts "cypher:cypher,cql"
dhall--formats-exts "dhall:dhall"
dns-zone-file--formats-exts "dns-zone-file:zone"
ebnf--formats-exts "ebnf:ebnf"
editorconfig--formats-exts "editorconfig:editorconfig"
factor--formats-exts "factor:factor"
ftl--formats-exts "ftl:ftl"
gcode--formats-exts "gcode:gcode,nc"
gml--formats-exts "gml:gml"
go-module--formats-names "go-module:go.mod"
hlsl--formats-exts "hlsl:hlsl,hlsli"
jq--formats-exts "jq:jq"
kusto--formats-exts "kusto:kql"
mermaid--formats-exts "mermaid:mmd"
mongodb--formats-exts "mongodb:mongo"
n1ql--formats-exts "n1ql:n1ql"
odin--formats-exts "odin:odin"
regex--formats-exts "regex:regex"
rego--formats-exts "rego:rego"
shell-session--formats-exts "shell-session:sh-session,console"
smali--formats-exts "smali:smali"
stata--formats-exts "stata:do,ado"
typoscript--formats-exts "typoscript:typoscript,tsconfig"
vala--formats-exts "vala:vala,vapi"

Shebang Detection

jscpd can detect duplications in script files that have no file extension by reading the #! shebang line:

InterpreterDetected as
bash, sh, zsh, fish, dash, kshbash
python, python3, python2python
node, nodejsjavascript
rubyruby
perlperl
phpphp
lualua
tclsh, wishtcl
Rscriptr
groovygroovy
swiftswift
kotlinkotlin

Custom Format Extensions

Associate custom file extensions with a format:

jscpd --formats-exts "javascript:js,es6,vue" ./src

Or in configuration:

.jscpd.json
{
  "formatsExts": {
    "javascript": ["js", "es6", "vue"]
  }
}

Custom Filename Mapping

Map extensionless files to a format by filename:

jscpd --formats-names "makefile:Makefile,GNUmakefile;docker:Dockerfile" ./src

Or in configuration:

.jscpd.json
{
  "formatsNames": {
    "makefile": ["Makefile", "GNUmakefile"],
    "docker": ["Dockerfile"]
  }
}

View Full List

You can also view the full list of supported formats by running:

jscpd --list