I have heard somewhere that it's possible to create just one ESlint preset for all Lerna subrepositories, but when begin to collect info actively about this did not found clear information.
Why it's attractive
If I want change the settings for ESLint (or TSLint) for all sub-repositories, it takes some time to edit .eslintrc
in each project.
The problem
Off course, we can put .eslintrc
in the top level of monorepo (at the same level with lerna.json
). But when we will open one of sub-repositories in IDE, it will not search .eslintrc
outside the project. So I suppose .eslintrc
must me in the root of each sub-repository. Does Lerna solve this problem?
.eslintrc.js
, 2. add a new.eslintrc.js
in each package folder, 3. addextends: [path.join(__dirname, '../.eslintrc.js')],
to each package, 4. customize each file as needed. NOTE that step #4 is important since customization is often inescapable. If you only had one file, it would only work for very homogenous projects, however most projects are not that; e.g. one package is frontend+react
, one is a server running onnode
, one is acli
onnode
etc etc – Ebonee