Skip to content

Commit f0050e1

Browse files
fixed class definition substr
1 parent 54301d4 commit f0050e1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ A tool for analyzing CSS modules in Next.js projects. The linter detects **unuse
66
- Project-wide analysis with warnings displayed in the editor
77
- High performance thanks to Rust-based implementation
88
- 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
1011

1112
## 🔹 Usage
1213
Linting runs automatically **on file save**, and warnings are displayed in the workspace.

vscode-ext/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "next-css-lint",
33
"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",
66
"license": "MIT",
77
"repository": "https://github.com/Andcool-Systems/css-linter",
88
"author": {

vscode-ext/src/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export class CssModuleDefinitionProvider implements vscode.DefinitionProvider {
173173
const lines = fileContent.split('\n');
174174

175175
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-_])`))) {
177178
const definitionUri = vscode.Uri.file(resolvedPath);
178179
const definitionPosition = new vscode.Position(i, 0);
179180
return new vscode.Location(definitionUri, definitionPosition);

0 commit comments

Comments
 (0)