0.0.4 • Published 5 years ago
eslint-config-usual-ridesz v0.0.4
eslint-config-usual-ridesz
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 eslint-config-usual-ridesz @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-prettier prettier typescriptAdd stuffs to the package.json
Add this eslint config part to your package.json:
"eslintConfig": {
  "extends": "eslint-config-usual-ridesz"
},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:eslintThis 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:eslintIf you would like to get some auto fixes then use the same command with the :fix postfix:
npm run test:eslint:fixSome implementation details
I skip the check of some dependency and output folders I usually have:
- node_modules: dependencies
- lib: compiled code for the library
- build: compiled code for a top level project
- reports: generated reporst (documentation, dependency graph, etc.)