You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a custom templates folder (blitz generate custom-templates). And we use npm run type-check with tsc --noEmit to check the types of all files in our projects.
Since we added the custom templates, those files show errors in tsc due to the needed template language.
I now excluded the templates folder in my tsconfig.json with "exclude": ["node_modules", "**/*.e2e.ts", "cypress", "src/core/templates"],.
Does anyone see an downside to this? And if not, would a PR to add a hint on the docs page be welcome?
Update 2022-01-11: The same is true for eslint. I had to update my package.json like this so there is no error.
In case someone searched for the error message, here it is:
/MY_PATH/src/core/templates/page/index.tsx
0:0 error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/core/templates/page/index.tsx` using `parserOptions.project`: <tsconfigRootDir>/../../../../MY_PATH/tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting##i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have a custom templates folder (
blitz generate custom-templates
). And we usenpm run type-check
withtsc --noEmit
to check the types of all files in our projects.Since we added the custom templates, those files show errors in
tsc
due to the needed template language.I now excluded the templates folder in my
tsconfig.json
with"exclude": ["node_modules", "**/*.e2e.ts", "cypress", "src/core/templates"],
.Does anyone see an downside to this? And if not, would a PR to add a hint on the docs page be welcome?
Update 2022-01-11: The same is true for eslint. I had to update my
package.json
like this so there is no error.In case someone searched for the error message, here it is:
The eslint docs suggest different approached. The one using the separate package.json entry did not work. The one above does. https://eslint.org/docs/latest/user-guide/configuring/ignoring-code#the-eslintignore-file
I think that should be hinted on the the docs as well. I can make a PR if this is desireable.
Beta Was this translation helpful? Give feedback.
All reactions