1.5.1 • Published 8 months ago

@rubiin/eslint-config-ts v1.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@rubiin/eslint-config

npm

Usage

Install

pnpm add -D eslint @rubiin/eslint-config-ts

Config .eslintrc

{
  "extends": "@rubiin/eslint-config-ts"
}

You don't need .eslintignore normally as it has been provided by the preset.

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
// .eslintrc.js
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
  extends: '@rubiin/eslint-config-ts'
}

Lint Staged

If you want to apply lint and auto-fix before every commit, you can add the following to your package.json:

{
  "simple-git-hooks": {
    "pre-commit": "pnpm lint-staged"
  },
  "lint-staged": {
    "*": "eslint --fix"
  }
}

and then

npm i -D lint-staged simple-git-hooks

FAQ

I prefer XXX...

Sure, you can override the rules in your .eslintrc file.

{
  "extends": "@rubiin/eslint-config-ts",
  "rules": {
    // your rules...
  }
}

Or you can always fork this repo and make your own.

Check Also

License

MIT License © 2019-PRESENT Rubiin