[Feature]: Handle linting of root folder files via o3r/eslint-config #2687
Open
Description
Context
Today, if we setup eslint via ng add @o3r/eslint-config
in an o3r generated monorepo, the linter is configured to run on the app and lib files, but the files in the root folder (such as the root /jest.config.js
file) are not linted, because no config exists for the root folder files.
This also causes, as a side effect, a discrepancy between the files linted by the CI, by lint-staged
, and by the IDE:
- CI: if you run
npm run lint
, files in the root folder are not linted. - lint-staged: if you run the pre-commit hooks on a root folder file,
lint-staged
script will lint this file. - IDE: lint issues in the root folder files will be raised by your IDE.
Proposal
Today, the linting of apps/libs is handled via the script "lint": "lerna run lint"
.
We could add to this command a parallel or subsequent process that runs eslint ./*.*
to lint the root files. However, the command output will not look as readable as with the lerna
command only, which may deteriorate the dev exp.
Any better suggestion is welcome.