eslint-plugin-tailwind-canonical-classes 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -148,6 +148,7 @@ const rule = {
|
|
|
148
148
|
return {};
|
|
149
149
|
}
|
|
150
150
|
let cssPath;
|
|
151
|
+
let resolvedViaWalkUp = false;
|
|
151
152
|
if (path.isAbsolute(options.cssPath)) {
|
|
152
153
|
cssPath = path.normalize(options.cssPath);
|
|
153
154
|
}
|
|
@@ -158,6 +159,7 @@ const rule = {
|
|
|
158
159
|
// the wrong location. When that happens, walk up from the file being
|
|
159
160
|
// linted until we find a directory that contains the CSS file.
|
|
160
161
|
if (!fs.existsSync(cssPath)) {
|
|
162
|
+
resolvedViaWalkUp = true;
|
|
161
163
|
const filename = context.filename ?? context.getFilename?.();
|
|
162
164
|
if (filename) {
|
|
163
165
|
let dir = path.dirname(filename);
|
|
@@ -185,6 +187,12 @@ const rule = {
|
|
|
185
187
|
'cva',
|
|
186
188
|
];
|
|
187
189
|
if (!fs.existsSync(cssPath)) {
|
|
190
|
+
// When the walk-up was attempted and still found nothing, the linted file
|
|
191
|
+
// likely lives in an unrelated project inside the monorepo — silently
|
|
192
|
+
// disable the rule instead of reporting an error on every file.
|
|
193
|
+
if (resolvedViaWalkUp) {
|
|
194
|
+
return {};
|
|
195
|
+
}
|
|
188
196
|
context.report({
|
|
189
197
|
node: sourceCode.ast,
|
|
190
198
|
messageId: 'cssNotFound',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-tailwind-canonical-classes",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "ESLint plugin to enforce canonical Tailwind CSS class names using Tailwind CSS v4's canonicalization API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|