Comments (4)
Hi @tiwariav , thanks for reporting this. Can you please provide the reproduce steps for the issue following this example:
Repro Code
import 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 Result
Expected no errors
Actual Result
Received error:
Class or exported property 'someAnimation' not found
from eslint-plugin-css-modules.
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
```
from eslint-plugin-css-modules.
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 Result
Expected no errors
Actual Result
Received error:
TypeError: Cannot set properties of null (setting 'nested')
Can check here as well.
https://codesandbox.io/p/sandbox/brave-mopsa-ycnv8f?file=%2Fsrc%2Findex.tsx%3A6%2C1
from eslint-plugin-css-modules.
From what I have tried, its only giving error if using nested classes. Although the same works fine with previous version.
from eslint-plugin-css-modules.
Related Issues (20)
- css-modules/no-undef-class error HOT 3
- Bug: Memory leak causing crash when linting many (3500+) files
- Print CSS filename when warning for unused classes with no-unused-class HOT 3
- Q: Is it possible to use this with typescript? HOT 5
- 2.9.0 - Cannot read property 'content' of undefined HOT 4
- False negative with :not HOT 1
- False "css-modules/no-undef-class" with keyframes
- "Definition for rule was not found" for [email protected] HOT 2
- Support custom extension
- Why do you support classes only, no IDs? HOT 4
- eslint-plugin-css-modules does not understand :local()
- Does not play well with Node.12, Visual Code and possibly other Electron based editors HOT 1
- no-unused-class for scss mixins HOT 2
- Mark dynamically interpolated classes as used
- Parsing error: Unexpected keyword or identifier
- It doesn't work with path-alias
- False positive alarm on unused class when using scss & parent selector
- no-undef-class dismisses classes within :global(.class) {
- Doesn't work anymore with new import * as style from './component.scss
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-css-modules.