@bamboocss/eslint-plugin 1.13.1 → 1.14.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/index.cjs CHANGED
@@ -8,7 +8,7 @@ require("@typescript-eslint/utils/ts-eslint");
8
8
  let _bamboocss_shared = require("@bamboocss/shared");
9
9
  //#region package.json
10
10
  var name = "@bamboocss/eslint-plugin";
11
- var version = "1.13.1";
11
+ var version = "1.14.0";
12
12
  //#endregion
13
13
  //#region src/utils/index.ts
14
14
  const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
@@ -612,13 +612,23 @@ const rule$13 = createRule({
612
612
  const [start, end] = range;
613
613
  return [start + 1, end - 1];
614
614
  };
615
+ const isEscapeHatch = (value) => (0, _bamboocss_shared.getArbitraryValue)(value) !== value.trim();
615
616
  const hasEscapeHatch = (value) => {
616
617
  if (!value) return false;
617
618
  if (!value.includes("[")) return false;
618
- return (0, _bamboocss_shared.getArbitraryValue)(value) !== value.trim();
619
+ const candidates = (0, _bamboocss_shared.parseFallbackValue)(value);
620
+ if (candidates) return candidates.some(isEscapeHatch);
621
+ return isEscapeHatch(value);
619
622
  };
620
623
  const handleNodeValue = (node, value) => {
621
624
  if (!hasEscapeHatch(value)) return;
625
+ if ((0, _bamboocss_shared.parseFallbackValue)(value)) {
626
+ context.report({
627
+ messageId: "escapeHatch",
628
+ node
629
+ });
630
+ return;
631
+ }
622
632
  context.report({
623
633
  messageId: "escapeHatch",
624
634
  node,
package/dist/index.mjs CHANGED
@@ -5,10 +5,10 @@ import { fileURLToPath } from "node:url";
5
5
  import { isNodeOfType, isNodeOfTypes } from "@typescript-eslint/utils/ast-utils";
6
6
  import { analyze } from "@typescript-eslint/scope-manager";
7
7
  import "@typescript-eslint/utils/ts-eslint";
8
- import { getArbitraryValue } from "@bamboocss/shared";
8
+ import { getArbitraryValue, parseFallbackValue } from "@bamboocss/shared";
9
9
  //#region package.json
10
10
  var name = "@bamboocss/eslint-plugin";
11
- var version = "1.13.1";
11
+ var version = "1.14.0";
12
12
  //#endregion
13
13
  //#region src/utils/index.ts
14
14
  const createRule = ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
@@ -612,13 +612,23 @@ const rule$13 = createRule({
612
612
  const [start, end] = range;
613
613
  return [start + 1, end - 1];
614
614
  };
615
+ const isEscapeHatch = (value) => getArbitraryValue(value) !== value.trim();
615
616
  const hasEscapeHatch = (value) => {
616
617
  if (!value) return false;
617
618
  if (!value.includes("[")) return false;
618
- return getArbitraryValue(value) !== value.trim();
619
+ const candidates = parseFallbackValue(value);
620
+ if (candidates) return candidates.some(isEscapeHatch);
621
+ return isEscapeHatch(value);
619
622
  };
620
623
  const handleNodeValue = (node, value) => {
621
624
  if (!hasEscapeHatch(value)) return;
625
+ if (parseFallbackValue(value)) {
626
+ context.report({
627
+ messageId: "escapeHatch",
628
+ node
629
+ });
630
+ return;
631
+ }
622
632
  context.report({
623
633
  messageId: "escapeHatch",
624
634
  node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/eslint-plugin",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "description": "ESLint plugin for Bamboo CSS",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -36,9 +36,9 @@
36
36
  "@typescript-eslint/utils": "^8.21.0",
37
37
  "micromatch": "^4.0.8",
38
38
  "synckit": "^0.9.0",
39
- "@bamboocss/config": "1.13.1",
40
- "@bamboocss/generator": "1.13.1",
41
- "@bamboocss/shared": "1.13.1"
39
+ "@bamboocss/config": "1.14.0",
40
+ "@bamboocss/generator": "1.14.0",
41
+ "@bamboocss/shared": "1.14.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/micromatch": "^4.0.10",
@@ -46,10 +46,10 @@
46
46
  "eslint": "^9.35.0",
47
47
  "multiline-ts": "^4.0.1",
48
48
  "typescript": "^5.7.2",
49
- "@bamboocss/dev": "1.13.1",
50
- "@bamboocss/preset-bamboo": "1.13.1",
51
- "@bamboocss/preset-base": "1.13.1",
52
- "@bamboocss/types": "1.13.1"
49
+ "@bamboocss/dev": "1.14.0",
50
+ "@bamboocss/preset-bamboo": "1.14.0",
51
+ "@bamboocss/preset-base": "1.14.0",
52
+ "@bamboocss/types": "1.14.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "eslint": "*"