silx-kit / h5web

React components for data visualization and exploration
https://h5web.panosc.eu/
MIT License
195 stars 19 forks source link

Fix minor linting and type-checking configuration issues #1678

Closed axelboc closed 5 months ago

axelboc commented 5 months ago

Whenever I was opening a file at the root of the repo, like cypress.config.ts, VS Code would notify me to properly configure excluded files in tsconfig.json.

I used this technique to find out which files were included by the root tsconfig.json. Since we didn't use to specify include or exclude, the defaults applied as expected, which meant that node_modules folders were properly excluded but not build folders.

Keeping with our approach of using include over exclude to specify files to type-check, I add an include array in the root tsconfig.json that includes all the files that are not included by other tsconfig.json files:

Technically, the Cypress files are already included by their own tsconfig.json, but I had to include them in the root tsconfig.json as well because of ESLint.

While I was debugging included files, I also noticed that the apps/storybook/.storybook folder was neither linted nor type-checked. This comment helped me solve the issue.

For future reference:

  • to list files included by TS, use flag --listFilesOnly
  • to list files linted by ESLint, use environment variable DEBUG=eslint:cli-engine