For some reason, my .eslintrc.json has some option, or has a lack of some option to catch the warning
Object is possibly 'null'
What I need to change to eslint notify my about this warning?
IMPORTANT this is on my unit tests, so adding strictNullChecks does not work for my project, that why I asked if eslint has an option for that.
{
"settings": {
"react": {
"version": "latest"
}
},
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"@typescript-eslint/no-inferrable-types": "off"
},
"ignorePatterns": ["dist/*"]
}
My tsconfig.json
{
"exclude": ["lib/**/*.spec.tsx", "lib/**/*.stories.tsx", "lib/**/*.styles.tsx", "settings/**/*", "dist/**/*"],
"compilerOptions": {
"skipLibCheck": true,
"target": "es5",
"lib": ["es5", "dom"],
"jsx": "react",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"rootDirs": ["lib"],
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
}
}
from ESLint activate option to notify "Object is possibly null"
No comments:
Post a Comment