Skip to content
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

Export the plugin name #173

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Export the plugin name #173

wants to merge 3 commits into from

Conversation

r13v
Copy link

@r13v r13v commented Feb 20, 2025

The typescript-plugin-css-modules rely on the plugin name to distinguish the plugins to load. It will omit the postcss-nested plugin without the exported postcssPlugin. Therefore, the IDE does not have intelligence for the nested selectors.

@ai
Copy link
Member

ai commented Feb 20, 2025

According to PostCSS types it is a correct API:

 export interface PluginCreator<PluginOptions> {
    (opts?: PluginOptions): Plugin | Processor
    postcss: true
  }

Maybe we need to fix typescript-plugin-css-modules? Or you can add () after plugin in your config as a quick fix.

@r13v
Copy link
Author

r13v commented Feb 20, 2025

@ai Sorry, my bad. The postcssPlugin property should be defined in the plugin creator like the postcss-mixins do.

@ai
Copy link
Member

ai commented Feb 20, 2025

No, the current API is correct. Seems like we have typescript-plugin-css-modules issue.

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

Successfully merging this pull request may close these issues.

2 participants