Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Use TypeScript tsconfig include instead of exclude
This helps to prevent hard-to-discover build failures, that only happen on clean installs (e.g. CI). This is because TypeScript will by default scan the entire source dictionary (Build/ in our case) for possible includes. We previously excluded /Build/composer in #95046, but it is actually much better to explicitly include the actually used source paths to also exclude build output (Build/JavaScript/) from being reinterpreted by subsequential eslint or tsc compile runs. Note that we also refactor the types/ directory in order to be a folder that conforms to the @types/* packages conventions, by being actually usable in the compilerOptions.types property. Note that our custom global type definitions (types/) were previously implicitly loaded as globally available sourcepaths. With the new `include` option we could add them back, but then we wouldn't notice if we do not add proper index.d.ts files (like we did until now). Therefore index.d.ts files are added in here. Now, with TypeScript being "clean", we need a another small adjustment in order for eslint to still being able to lint our types/ folder. Therefore tsconfig.json is extended to include the types directory. See [1] for more information on why eslint needs that. [1] 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 Resolves: #101782 Related: #95046 Releases: main, 12.4 Change-Id: I3ab8b874192d25470bbd5e71cc5d99e853259f89 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80739 Tested-by: Andreas Fernandez <[email protected]> Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Fernandez <[email protected]> Reviewed-by: Benjamin Franzke <[email protected]> Tested-by: Benjamin Franzke <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: core-ci <[email protected]>
- Loading branch information