File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ A tool for analyzing CSS modules in Next.js projects. The linter detects **unuse
6
6
- Project-wide analysis with warnings displayed in the editor
7
7
- High performance thanks to Rust-based implementation
8
8
- Support for ` import aliases ` from ` tsconfig.json `
9
- - Ability to ignore specific warnings
9
+ - Ability to ignore specific warnings
10
+ - Find definitions for your CSS classes
10
11
11
12
## 🔹 Usage
12
13
Linting runs automatically ** on file save** , and warnings are displayed in the workspace.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " next-css-lint" ,
3
3
"displayName" : " Next.Js CSS linter" ,
4
- "description" : " Displaying unused CSS classes in Next.Js projects" ,
5
- "version" : " 1.7.3 " ,
4
+ "description" : " Display unused CSS classes in Next.Js projects and search for class definitions " ,
5
+ "version" : " 1.7.4 " ,
6
6
"license" : " MIT" ,
7
7
"repository" : " https://github.com/Andcool-Systems/css-linter" ,
8
8
"author" : {
Original file line number Diff line number Diff line change @@ -173,7 +173,8 @@ export class CssModuleDefinitionProvider implements vscode.DefinitionProvider {
173
173
const lines = fileContent . split ( '\n' ) ;
174
174
175
175
for ( let i = 0 ; i < lines . length ; i ++ ) {
176
- if ( lines [ i ] . includes ( `.${ propertyName } ` ) ) {
176
+ let line = lines [ i ] . trimStart ( ) ;
177
+ if ( line . match ( new RegExp ( `\\.${ propertyName } (?![a-zA-Z0-9-_])` ) ) ) {
177
178
const definitionUri = vscode . Uri . file ( resolvedPath ) ;
178
179
const definitionPosition = new vscode . Position ( i , 0 ) ;
179
180
return new vscode . Location ( definitionUri , definitionPosition ) ;
You can’t perform that action at this time.
0 commit comments