-
Notifications
You must be signed in to change notification settings - Fork 34
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
TypeError: Cannot set properties of null (setting '...'), when using markAsUsed comments #93
Comments
Hi @tiwariav , thanks for reporting this. Can you please provide the reproduce steps for the issue following this example: Repro Codeimport s from './animationName.scss';
export default Foo = () => (
<div>
<div className={s.someAnimation}></div>
</div>
); @keyframes someAnimation {} ESLint Config{
"plugins": ["css-modules"],
"extends": ["plugin:css-modules/recommended"]
} Expected ResultExpected no errors Actual ResultReceived error:
|
Template for above: ### Repro Code
```javascript
import s from './animationName.scss';
export default Foo = () => (
<div>
<div className={s.someAnimation}></div>
</div>
);
```
```css
@keyframes someAnimation {}
```
### ESLint Config
```json
{
"plugins": ["css-modules"],
"extends": ["plugin:css-modules/recommended"]
}
```
### Expected Result
Expected no errors
### Actual Result
Received error:
```
Class or exported property 'someAnimation' not found
``` |
Repro Code/* eslint css-modules/no-unused-class: [2, {camelCase: true, markAsUsed:
['nested']
}] */
import styles from './styles.scss';
export default Foo = () => (
<div className={styles.root}>
<div className={styles.nested}></div>
</div>
); .root {
color: green;
& .nested {
color: red;
}
} ESLint Config{
"plugins": ["css-modules"],
"rules": {
"css-modules/no-undef-class": ["warn", { "camelCase": true }],
"css-modules/no-unused-class": ["error", { "camelCase": true }],
}
} Expected ResultExpected no errors Actual ResultReceived error:
Can check here as well. |
From what I have tried, its only giving error if using nested classes. Although the same works fine with previous version. |
The issue is in the version 2.12.0, works fine for 2.11.4
The text was updated successfully, but these errors were encountered: