Skip to content

JoshuaKGoldberg/repros

 
 

Repository files navigation

Repo: typescript-eslint Project Service Compiler Options on Non-Included Files

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 to include: 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.

About

Reproductions and larger code snippets I need to reference online.

Resources

License

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy