NtsDK
NtsDK

Reputation: 971

Is it possible to use TypeScript strictNullCheck as eslint rule?

I have code base with errors which can be found by strictNullChecks. But strictNullChecks compiler rule is only on/off. I can't just fix/comment all problems to make TypeScript happy. I want to raise warnings or eslint warnings for strict checks.

I tried to find applicable rule in typescript-eslint but I don't see any suitable.

Are there any possibilities to get strict TypeScript errors as eslint warnings?

Upvotes: 11

Views: 2159

Answers (1)

Gpack
Gpack

Reputation: 2193

I'm using this repo for this: https://github.com/JaroslawPokropinski/eslint-plugin-strict-null-checks.

Basically you can create a tsconfig.eslint.json which extends your main tsconfig.json and set up your eslint config to use it together with the plugin.
All the instructions are in the README.

Upvotes: 1

Related Questions