Install the Komaci Static Analyzer
The Komaci static analyser is an ESLint plugin that you install using a package manager, such as NPM or Yarn.
Use Terminal (or your command line tool of choice) to run all commands from the root directory of your Lightning web components project.
-
Add the Komaci Static Analyzer plugin and its dependencies to the development dependencies of your project.
NPM
YARN
-
Install all project modules and dependencies locally in the project.
NPM
YARN
-
Configure your project to use the new plugin.
Configuration depends on your ESLint version. Add your configuration at the root directory of your LWC “tree”, which by default resides at force-app/main/default/lwc/.
ESLint 9 and later (Flat Config)
Use the
recommendedconfig in your eslint.config.js and eslint.config.mjs file.eslint.config.js
eslint.config.mjs
ESLint 8 and earlier (Legacy Config)
The configurations for legacy ESLint are now found in extensions with the
-legacysuffix. An example of this is the following.eslintrc.jsonfile, which sets up theeslint-plugin-lwc-graph-analyzerplugin using therecommended-legacyconfiguration:If you have an .eslintignore configuration in your project, do not add an entry to ignore HTML files. This causes the plugin to skip linting on LWC bundles that include HTML templates. There are a number of Komaci-based static analysis rules that apply specifically to the HTML template of a Lightning web component bundle.