Skip to main content

Module section

Module section 

Source
Expand description

The dead-code section of a jscpd config file.

A project that already keeps a .jscpd.json should not need a second file, and should not have to repeat on every command line what it said once. The section is one object under deadCode — or dead-code, or basta; they are the same key — and both front ends read it the same way:

{
  "threshold": 5,
  "deadCode": {
    "minConfidence": 80,
    "entry": ["src/handlers/**"],
    "framework": ["next"],
    "frameworks": [{ "name": "kiosk-router", "detect": { "packageJsonKeys": ["kioskRouter"] },
                     "entry": ["screens/**/*.screen.js"] }]
  }
}

Everything in it has a flag of the same name, and the flag wins. The struct lives here rather than in jscpd so that the two readers cannot drift: jscpd embeds it in its own config type, the basta binary finds the file by the same cascade jscpd uses and reads this one key out of it.

Structs§

Section
Dead-code settings a project keeps in its jscpd config.

Constants§

KEYS
The names the section goes by in a config file. deadCode is the spelling jscpd’s other keys use; dead-code is the flag’s; basta is the tool’s.