mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
imported exist in the file system. Initally, we wanted to create a `.d.ts` file for each CSS file to ensure that the file being imported actually exists. However, when ninja is building `tsc` uses the generated `tsconfig` file in `gen`. In the `tsconfig.json` `files` list it will see the original TS file that's in the source tree. When it goes to see the TS file and sees the `import styles from 'foo.css.js'`. However, that file does not exist in the files list of the entrypoint or the source tree, so TS never finds it. Instead we went with the approach of adding a `declare module` to type all `.css.js` files and then use a lint rule to ensure that if you import `foo.css.js` that there is a `foo.css` file in the tree. Bug: 1106746 Change-Id: I8a65734bf4a9b359f8210b0011f14800c5d9426b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2953260 Commit-Queue: Kriti Sapra <kritisapra@google.com> Commit-Queue: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>