@lego/tslint-config
Prerequisites
- don't use any of the configs as globally installed modules
Installation
Install this config package:
$ npm i -D @lego/tslint-config
Usage
Full Configurations
This package includes the following complete and ready to use configurations:
@lego/tslint-config
- Base config + Prettier@lego/tslint-config/lib/configurations/typescript
- Base Config + Prettier@lego/tslint-config/lib/configurations/typescript-react
- Base Config + React config + Prettier
add the above preferred configuration in your tslint.json file as f.ex:
{
"extends": "@lego/tslint-config"
}
Rules
This package currently implements rules from the following packages:
[x] https://github.com/palantir/tslint-react
[x] https://github.com/palantir/tslint
[x] https://github.com/ajafff/tslint-consistent-codestyle
[x] https://github.com/prettier/tslint-config-prettier
A future release will add LEGO custom rules for Angular projects.
[ ] https://github.com/mgechev/codelyzer
if you would like to use codelyzer in the meanwhile, with your own rules, it's imperative that you follow the following
steps:
You can use the tslint-angular
preset. All you need is:
$ npm i tslint-angular
After that create a tslint.json
file with the following configuration, note that the order is important.
{
"extends": ["tslint-angular", "@lego/tslint-config"]
}
Overriding Rules
With the above tslint.json
configuration example, you can still use or override already defined
rules as such:
{
"extends": "@lego/tslint-config",
"rules": {
"no-submodule-imports": [true, "mobx", "mobx-react"]
}
}
It's recommended to inspect the defined rule's configuration where the reasoning for the
configuration lives. If a configuration could benefit more than just the project you're working on,
feel free to create a pull request.