This reproduction shows that using the new typescript-eslint EXPERIMENTAL_useProjectService
to lint a non-included file doesn't receive tsconfig.json
compiler options.
npm i
cp tsconfig.baseline.json tsconfig.json
npm run lint
/Users/josh/repos/repros/.eslintrc.cjs
0:1 error This rule requires the `strictNullChecks` compiler option to be turned on to function correctly @typescript-eslint/no-unnecessary-condition
Two steps must be done in the tsconfig.json
to include a .eslintrc.cjs
:
- Enable
compilerOptions.allowJs
: because it's a JavaScript extension - Add
"./.*"
or similar toinclude
: because it's a dot-file
Changing tsconfig.json
in those two ways allows the project service to pick up the compiler options for the file:
cp tsconfig.working.json tsconfig.json
npm run lint
Filed as typescript-eslint/typescript-eslint#8206.