Description
Description
CSS Modules files with any class that include the composes
keyword break the export for that file, in the context of the plugin. As noted, not only the class that include that keyword doesn't seem visible to the plugin, but any on the same file too. The three types of possible origin for the composes
setting: from the same file, other files, or global classes produce the same result of an empty object {}
as the object exported.
The composes
keyword is defined in the CSS Modules spec in:
https://github.com/css-modules/css-modules#dependencies
It's also supported through Webpack's CSS Loader in:
https://webpack.js.org/loaders/css-loader/#composing
The project builds the classes including these composed classes correctly and as expected through the use of the webpack loader and config.
To Reproduce
Steps to reproduce the behaviour:
- Define a CSS Modules file, e.g:
index.module.css
- Set the composes keyword in one of its classes, e.g:
cardContainer
- Import the CSS Module file on a TS file, e.g:
import styles from './index.module.css';
- Use any of the classes exported by the CSS Module, e.g:
textContainer
Property 'textContainer' does not exist on type '{}'.ts(2339)
Expected behaviour
Classes should still be understood as exported as usual, whether some of them include the composes
keyword or not.
Screenshots
Desktop
- OS: GNU/Linux, Linux Mint 21.1 Cinnamon
- Editor: VS Code 1.75.1
- Browser: Not applicable