8000 feat: support tailwind v4 by hyoban · Pull Request #413 · francoismassart/eslint-plugin-tailwindcss · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
no throw error
  • Loading branch information
hyoban committed May 6, 2025
commit b2575a825b103819e9e41c44fc1473dabcdbc9c4
14 changes: 4 additions & 10 deletions lib/util/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ try {
const CAN_NOT_RESOLVE_TAILWIND_CONFIG_PATH_ERROR =
'Cannot resolve default tailwindcss config path. Please manually set the config option.';

function notice() {
if (process.env.NODE_ENV === 'test') {
return {};
} else {
throw new Error(CAN_NOT_RESOLVE_TAILWIND_CONFIG_PATH_ERROR);
}
}

function getOption(context, name) {
// Options (defined at rule level)
const options = context.options[0] || {};
Expand All @@ -39,11 +31,13 @@ function getOption(context, name) {
return '^class(Name)?$';
case 'config':
if (resolveDefaultConfigPathAlias === null) {
return notice();
console.warn(CAN_NOT_RESOLVE_TAILWIND_CONFIG_PATH_ERROR);
return {};
} else {
const path = resolveDefaultConfigPathAlias();
if (!path) {
return notice();
console.warn(CAN_NOT_RESOLVE_TAILWIND_CONFIG_PATH_ERROR);
return {};
}
return path;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyoban/eslint-plugin-tailwindcss",
"version": "4.0.0-alpha.10",
"version": "4.0.0-alpha.11",
"description": "Rules enforcing best practices while using Tailwind CSS",
"keywords": [
"eslint",
Expand Down