ESLint is a popular linting tool for JavaScript. It provides numerous static-analysis rules that help developers write quality code.

The Code Analyzer scanner run command uses ESLint to scan targeted JavaScript files. By default, all rules are executed, but you can change which rules are evaluated through Code Analyzer optional flags described in the Code Analyzer Command Reference.

ESLint is highly configurable and Code Analyzer supports these plug-ins.

  • TypeScript-ESLint adds support for TypeScript, a strongly typed superset of JavaScript. By default, this plug-in is used to evaluate any targeted TypeScript (.ts) files.
  • ESLint-LWC, the official ESLint rules for Salesforce Lightning Web Components (LWC). ESLint rules aren’t enabled by default. They can be enabled on a per-run basis with the --engine eslint-lwc flag or on a permanent basis by directly modifying the config.json file.