Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share eslint file accross a team?

Background

I have an eslint file that I use across multiple Nodejs projects with my team. This file is important and I need to use it in every project, so I end up copying it over and over again.

Problem

This is a terrible idea because If I make a change to the eslint file, I need to manually copy/paste it into all the other projects and sometimes I forget which projects have the updated file and which projects don't.

Objective

My objective here would be to make it automatic. My first idea was to publish the eslint file in NPM, and then manage it via there.

The problem with this approach is that if I do npm install, NPM will place my lint file into the node_modules directory and thus nothing will work.

This file needs to be at the root of the project, side by side with package.json.

Question

How do I share this eslint file across multiple projects automatically?

like image 583
Flame_Phoenix Avatar asked Oct 22 '25 04:10

Flame_Phoenix


1 Answers

Answer

Turns out that you can use NPM packages to share ESLint files across multiple projects and teams, which was unknown to me:

http://engineering.invisionapp.com/post/sharing-eslint-across-teams/

The official documentation details how this can be done, and which conventions to follow:

http://eslint.org/docs/developer-guide/shareable-configs#creating-a-shareable-config

like image 146
Flame_Phoenix Avatar answered Oct 23 '25 18:10

Flame_Phoenix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!