Skip to content

javascript/eslint

Runs the shipped ESLint rules on JavaScript, TypeScript, component files, and package.json.

Part of the javascript configuration, at the recommended level. It runs at the commit stage, per file. It runs eslint. gspot check --fix fixes what it can.

ESLint catches mistakes that the runtime accepts: unused code, unsafe patterns, and functions that only forward.

Run gspot check --fix for the rules that fix themselves, then read each remaining line; gspot explain <rule> links the rule documentation.

The declaration const unused = 1; reports no-unused-vars. Delete the variable.

Turn it off for some files, or one of its lint rules, with a reason:

gspot ignore javascript/eslint --paths "<glob>" --reason "<why>"
gspot ignore javascript/eslint --rule <rule> --reason "<why>"

To silence one place, write a comment such as:

// eslint-disable-next-line no-console -- the command prints its result