eslint-config-ignw
v0.0.0
Published
IGNW standard eslint rules for Javascript, NodeJS, and Typescript projects.
Downloads
3
Readme
eslint-config-ignw
This package provides IGNW's .eslintrc as an extensible shared config for standarized linting of Javascript, NodeJS and Typescript projects.
How to consume this package in your project
Install peer dependencies for this package as dev dependencies for your project. Note that installing prettier isn't strictly neccessary but will allow your editor to autoformat your code based off configured eslint rules.
Create an .eslintrc
or .eslintrc.js
file in your project and inherit this packages configs using the extends
property:
{
"extends": "eslint-config-ignw"
}
If you only want a specific subset of linter rules you can do so like:
"extends": [
"eslint-config-ignw/react",
],
Finally add an npm run script for running the linter and automatically fixing auto fixable issues
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx . --fix"
},
How to develop this package
Development
Install package development dependencies
npm install
Update the rules in base.js
or add another subset of rules by creating a file (e.g. react.js
) and extending that in index.js
to export those new rules by default.
Testing / Self Linting
When developing you can lint the package itself by linking and consuming the local version of the package and then running the linter command for the package:
npm link
npm link eslint-config-ignw
npm run lint:fix
Similary to test out the changes to the linting package from another package, first run
npm link
from the eslint-config-ignw
directory, and then in the consuming package
npm link eslint-config-ignw
Finally run the consuming packages lint command to test out your changes.
Publishing
Checkout a branch, code and commit changes, get code reviewed and approved.
Once the code is approved update the packages version (using semver style) by running
npm version X.Y.Z
Log into to your npm account
npm login
Then publish the package to npm for public consumpation:
npm publish
How this package works
The folks at ESLint were kind enough to provide developer docs for shared eslint configs.
For an example of a mature eslint config see the AirBnB eslint config package.