On the official ESLint website, there is a section titled Per-rule Performance
.
It explains that
"setting the TIMING
environment variable will prompt the display of the ten longest-running rules upon linting completion, showing their individual running time and relative performance impact as a percentage of total rule processing time".
$ TIMING=1 eslint lib
Rule | Time (ms) | Relative
:-----------------------|----------:|--------:
no-multi-spaces | 52.472 | 6.1%
camelcase | 48.684 | 5.7%
no-irregular-whitespace | 43.847 | 5.1%
valid-jsdoc | 40.346 | 4.7%
handle-callback-err | 39.153 | 4.6%
space-infix-ops | 35.444 | 4.1%
no-undefined | 25.693 | 3.0%
no-shadow | 22.759 | 2.7%
no-empty-class | 21.976 | 2.6%
semi | 19.359 | 2.3%
However, when trying to run it with
"lint-js": "TIMING=1 eslint --ext .js,.jsx,.ts,.tsx src/js --cache --cache-strategy metadata"
in the "scripts"
section of package.json
and using
npm run lint-js
on a Windows OS
, you may encounter an error:
'TIMING' is not recognized as an internal or external command,
operable program or batch file.
Is there a way to execute TIMING=1
with eslint
on Windows OS?