Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single ESLint setting for all Lerna sub repositories?

Tags:

npm

eslint

lerna

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?

like image 857
Takeshi Tokugawa YD Avatar asked Nov 19 '19 23:11

Takeshi Tokugawa YD


People also ask

Can I use lerna with NPM?

Lerna is a popular and widely used tool written in JavaScript for setting and managing multi-package repositories for Node. js projects with npm and Git.

What is lerna Monorepo?

Introduction. Lerna is a tool for managing JavaScript projects with multiple packages. Lerna manages monorepos, which can hold projects containing multiple packages within itself. Monorepos can be challenging to manage because sequential builds and publishing individual packages take a long time.

What is lerna bootstrap?

“lerna bootstrap” is used to install all dependencies and any cross-dependencies between packages. This command is needed when the process is first set-up.


1 Answers

Just create a linter package within your lerna repo, install it in select packages or globally and then reference it via extend from .eslintrc

like image 132
Mikhail Trosman Avatar answered Oct 26 '22 04:10

Mikhail Trosman