@unocss/eslint-plugin 0.55.7 → 0.56.0

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.
package/dist/dirs.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const node_url = require('node:url');
4
4
 
5
- const distDir = node_url.fileURLToPath(new URL("../dist", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('dirs.cjs', document.baseURI).href))));
5
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
+ const distDir = node_url.fileURLToPath(new URL("../dist", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('dirs.cjs', document.baseURI).href))));
6
7
 
7
8
  exports.distDir = distDir;
package/dist/index.cjs CHANGED
@@ -183,6 +183,26 @@ const blocklist = utils.ESLintUtils.RuleCreator((name) => name)({
183
183
  if (node.value.type === "VLiteral")
184
184
  checkLiteral(node.value);
185
185
  }
186
+ },
187
+ // Attributify
188
+ VStartTag(node) {
189
+ const valueless = node.attributes.filter((i) => typeof i.key?.name === "string" && !IGNORE_ATTRIBUTES.includes(i.key?.name?.toLowerCase()) && i.value == null);
190
+ if (!valueless.length)
191
+ return;
192
+ for (const node2 of valueless) {
193
+ if (!node2?.key?.name)
194
+ continue;
195
+ const blocked = syncAction("blocklist", node2.key.name, context.filename);
196
+ blocked.forEach((i) => {
197
+ context.report({
198
+ node: node2,
199
+ messageId: "in-blocklist",
200
+ data: {
201
+ name: i
202
+ }
203
+ });
204
+ });
205
+ }
186
206
  }
187
207
  };
188
208
  if (context.parserServices == null || context.parserServices.defineTemplateBodyVisitor == null) {
package/dist/index.mjs CHANGED
@@ -177,6 +177,26 @@ const blocklist = ESLintUtils.RuleCreator((name) => name)({
177
177
  if (node.value.type === "VLiteral")
178
178
  checkLiteral(node.value);
179
179
  }
180
+ },
181
+ // Attributify
182
+ VStartTag(node) {
183
+ const valueless = node.attributes.filter((i) => typeof i.key?.name === "string" && !IGNORE_ATTRIBUTES.includes(i.key?.name?.toLowerCase()) && i.value == null);
184
+ if (!valueless.length)
185
+ return;
186
+ for (const node2 of valueless) {
187
+ if (!node2?.key?.name)
188
+ continue;
189
+ const blocked = syncAction("blocklist", node2.key.name, context.filename);
190
+ blocked.forEach((i) => {
191
+ context.report({
192
+ node: node2,
193
+ messageId: "in-blocklist",
194
+ data: {
195
+ name: i
196
+ }
197
+ });
198
+ });
199
+ }
180
200
  }
181
201
  };
182
202
  if (context.parserServices == null || context.parserServices.defineTemplateBodyVisitor == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/eslint-plugin",
3
- "version": "0.55.7",
3
+ "version": "0.56.0",
4
4
  "description": "ESLint plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -34,14 +34,14 @@
34
34
  "node": ">=14"
35
35
  },
36
36
  "dependencies": {
37
- "@typescript-eslint/utils": "^6.4.1",
37
+ "@typescript-eslint/utils": "^6.7.2",
38
38
  "magic-string": "^0.30.3",
39
39
  "synckit": "^0.8.5",
40
- "@unocss/config": "0.55.7",
41
- "@unocss/core": "0.55.7"
40
+ "@unocss/config": "0.56.0",
41
+ "@unocss/core": "0.56.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@unocss/eslint-plugin": "0.55.7"
44
+ "@unocss/eslint-plugin": "0.56.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "unbuild",