0.0.8 • Published 4 years ago
@ridesz/eslint-config-usual v0.0.8
@ridesz/eslint-config-usual
The typical eslint config I use for my TypeScript projects.
How to use
Install dependencies
Install the project and its peer dependencies as devDependency:
npm i --save-dev @ridesz/eslint-config-usual
Add stuffs to the package.json
Add this eslint config part to your package.json
:
"eslintConfig": {
"extends": "@ridesz/eslint-config-usual"
},
And please add some scripts
tag to your package.json
file too:
{
"test:eslint": "eslint ./**/*.ts --color --max-warnings 0",
"test:eslint:fix": "eslint --fix ./**/*.ts --color --max-warnings 0"
}
The color
makes the console output pretty and the max-warnings
makes the warnings forbidden too.
GitLab CI config
Please add the necessary parts to your .gitlab-ci.yml
file:
image: node:latest
stages:
- test
eslint:
stage: test
script:
- npm install
- npm run test:eslint
This would use the latest node image and do the eslint check as part of the test
stage.
Running manually
If you would like to run the linter manually then you can use the following command:
npm run test:eslint
If you would like to get some auto fixes then use the same command with the :fix
postfix:
npm run test:eslint:fix
Some implementation details
I skip the check of some dependency and output folders I usually have:
node_modules
: dependencieslib
: compiled code for the librarybuild
: compiled code for a top level projectreports
: generated reporst (documentation, dependency graph, etc.)