Skip to content

typescript-eslint doesn't know about the type given from the import #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
krainboltgreene opened this issue Nov 19, 2020 · 4 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@krainboltgreene
Copy link

The rule: https://github.com/typescript-eslint/typescript-eslint/blob/v4.8.1/packages/eslint-plugin/docs/rules/restrict-template-expressions.md

An example:
Screen Shot 2020-11-19 at 12 10 25 AM

@mrmckeb
Copy link
Owner

mrmckeb commented Nov 23, 2020

Hi @krainboltgreene, does your project have a .d.ts file as in the README?
https://github.com/mrmckeb/typescript-plugin-css-modules#custom-definitions

I think that will solve this issue, but let me know and I can dig further.

@mrmckeb mrmckeb added the question Further information is requested label Nov 23, 2020
@mrmckeb mrmckeb self-assigned this Nov 23, 2020
@krainboltgreene
Copy link
Author

It does! And I have the relevant definitions from the README.

@mrmckeb mrmckeb added help wanted Extra attention is needed and removed question Further information is requested labels Jan 24, 2021
@mrmckeb
Copy link
Owner

mrmckeb commented Jan 24, 2021

Hi @krainboltgreene, sorry for the long turnaround. Unfortunately I've tried a few ways and can't reproduce this.

This works as expected:
image

Here I get an error as expected:
image

If you can provide a repro repo or more info, I can dig deeper.

@mrmckeb mrmckeb added question Further information is requested and removed help wanted Extra attention is needed labels Jan 24, 2021
@mrmckeb mrmckeb closed this as completed Apr 22, 2021
@c-vetter
Copy link

c-vetter commented May 2, 2024

I had the same problem in a vite setup and found this issue. The custom definitions as per the README didn't quite work for me due to conflicts with vite's definitions. I added src/css-modules.d.ts with this content:

/// <reference path="../node_modules/vite/client.d.ts" />

Just posting here in case someone else bumps into this.

#264 adds a note about this to the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants