Typescript error when using tailwind Container queries plugin

Hello, I Just want to try the container queries, but I've got this error (see picture). Do you know what we are supposed to do here? I don't find any @types package available.
5 Replies
Tom
Tom•2y ago
looks like the plugin isnt installed (also i dont think this counts as typescript) cause its in a js file 😛
Ekaradon
EkaradonOP•2y ago
It's installed, I even have the source code accessible:
Ekaradon
EkaradonOP•2y ago
But it's JS Typing check is still done here because it's a cjs file, see tsconfig:
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"],
I suppose that I should just declare the types of this module. Just find it strange that no one raised the issue. I'm thinking I'm missing something here
praskoo
praskoo•2y ago
I did
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
require("@tailwindcss/container-queries"),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
require("@tailwindcss/container-queries"),
Idk if im missing something, but why is it asking for a declaration file in .cjs 🤔
Ekaradon
EkaradonOP•2y ago
Typing has been enforced all the way because this is the philosophy of t3-app: typesafety. And as you can see in the tsconfig file, you can expand the type check on files other than just ts/tsx. Thanks for the anwser nonetheless praskOo, I believe that it means it's yet too early to get a type definition here. Disabling warnings may probably be the best course of action here indeed.
Want results from more Discord servers?
Add your server