-
-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eslint-plugin): blocklist
rule cant match variants
#3370
Conversation
✅ Deploy Preview for unocss ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
packages/eslint-plugin/src/worker.ts
Outdated
return [...extracted.values()].filter(i => uno.isBlocked(i)) | ||
const values = [...extracted.values()] | ||
const blocked = await Promise.all(values.map(i => uno.isBlockedWithStrict(i))) | ||
return values.filter((_, i) => blocked[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's an eslint only feature, how about moving it out of core? Ideally we could have an option for it (I am ok with default strict)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to support strict mode directly in isBlocked
. I need to spend some time researching how to implement a simple sync API that removes variants
isBlockedWithStrict
functionblocklist
rule cant match variants
It seems that it is unrealistic to handle variants synchronously, I moved this function into |
This PR will add a new function
isBlockedWithStrict
to uno generator and fix the problem that eslint-plugin blocklist cannot match variantsbefore: It is actually blocked, but eslint-plugin will not prompt
after: