https://github.com/krzkaczor/typestrict
ESLint config focused on maximizing type safety 💪
https://github.com/krzkaczor/typestrict
tslint type-safety typescript
Last synced: 6 months ago
JSON representation
ESLint config focused on maximizing type safety 💪
- Host: GitHub
- URL: https://github.com/krzkaczor/typestrict
- Owner: krzkaczor
- Created: 2017-12-08T23:13:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-29T11:37:01.000Z (over 3 years ago)
- Last Synced: 2025-03-29T04:06:41.887Z (6 months ago)
- Topics: tslint, type-safety, typescript
- Language: JavaScript
- Homepage:
- Size: 76.2 KB
- Stars: 217
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
TypeStrict
Squash bugs before shipping them with TypeScript and ESLint!
ESLint config focused on maximizing type safety
# Installation
```bash
npm install --save-dev @typescript-eslint/eslint-plugin eslint-plugin-sonarjs eslint-config-typestrict
```👉 If you still use TSLint please use [typestrict@1](https://github.com/krzkaczor/TypeStrict/tree/838c8eaa599e349327d5eba8f40f70d572dc3be0)
# Usage
In your `.eslintrc.json`:
```json
{
"extends": "typestrict"
// ... add here your own rules
}
```Unfortunately, you need to install plugins that we depend on manually: `@typescript-eslint/eslint-plugin`, `eslint-plugin-sonarjs`
Remember to use `strict` compiler setting in `tsconfig.json`!
# Description
All rules in this config are focused on catching bugs in your code and be as not annoying as possible. They don't
care about your code style or formatting.`TypeStrict` combines rules from various rule sets: [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin),
[sonarJS](https://github.com/SonarSource/SonarJS),## Complete rules list
### ESLint
- [constructor-super](https://eslint.org/docs/rules/constructor-super)
- [no-invalid-this](https://eslint.org/docs/rules/no-invalid-this)
- [no-restricted-syntax](https://eslint.org/docs/rules/no-restricted-syntax) (with `"check-parameters"` and `{"ignore-pattern": "^_" }`)
- [use-isnan](https://eslint.org/docs/rules/use-isnan)### TypeScript ESLint
- [@typescript-eslint/no-unused-vars](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md) with `{"argsIgnorePattern": "^_"}`
- [@typescript-eslint/await-thenable](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md)
- [@typescript-eslint/no-floating-promises](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md)
- [@typescript-eslint/no-misused-new](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md)
- [@typescript-eslint/restrict-plus-operands](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-plus-operands.md)
- [@typescript-eslint/no-unnecessary-condition](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md)### SonarTS
- [no-all-duplicated-branches](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-all-duplicated-branches.md)
- [no-collection-size-mischeck](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-collection-size-mischeck.md)
- [no-duplicated-branches](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-duplicated-branches.md)
- [no-element-overwrite](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-element-overwrite.md)
- [no-identical-conditions](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-identical-conditions.md)
- [no-identical-expressions](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-identical-expressions.md)# Contributing
Do you have idea for new rule to be added? You don't agree with one of rules included? Feel free to create issue / PR.
Logo by [@codeandcats](https://github.com/codeandcats).
# License
MIT by [Krzysztof Kaczor](https://twitter.com/krzKaczor)