@bamboocss/eslint-plugin 1.12.2 → 1.12.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.
- package/dist/index.cjs +79 -94
- package/dist/index.d.cts +40 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.mjs +2130 -2316
- package/dist/utils/worker.cjs +155 -6
- package/dist/utils/worker.d.cts +53 -0
- package/dist/utils/worker.d.mts +54 -0
- package/dist/utils/worker.mjs +135 -4
- package/package.json +16 -16
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/utils--KVHU2cv.mjs +0 -164
- package/dist/utils--KVHU2cv.mjs.map +0 -1
- package/dist/utils-BbqZf2ZV.cjs +0 -217
- package/dist/utils-BbqZf2ZV.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
let synckit = require("synckit");
|
|
2
2
|
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
let node_url = require("node:url");
|
|
3
5
|
let _typescript_eslint_utils_ast_utils = require("@typescript-eslint/utils/ast-utils");
|
|
4
6
|
let _typescript_eslint_scope_manager = require("@typescript-eslint/scope-manager");
|
|
5
7
|
require("@typescript-eslint/utils/ts-eslint");
|
|
6
8
|
let _bamboocss_shared = require("@bamboocss/shared");
|
|
7
|
-
|
|
8
9
|
//#region package.json
|
|
9
10
|
var name = "@bamboocss/eslint-plugin";
|
|
10
|
-
var version = "1.12.
|
|
11
|
-
|
|
11
|
+
var version = "1.12.3";
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/utils/index.ts
|
|
14
|
+
const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
|
|
15
|
+
const isBase = process.env.NODE_ENV !== "test" || require("url").pathToFileURL(__filename).href.endsWith("dist/index.js");
|
|
16
|
+
const _syncAction = (0, synckit.createSyncFn)((0, node_path.join)((0, node_url.fileURLToPath)(new URL(isBase ? "./" : "../../dist", require("url").pathToFileURL(__filename).href)), "utils/worker.mjs"));
|
|
17
|
+
const cache = /* @__PURE__ */ new Map();
|
|
18
|
+
const syncAction = ((...args) => {
|
|
19
|
+
const cacheKey = JSON.stringify(args);
|
|
20
|
+
if (cache.has(cacheKey)) return cache.get(cacheKey);
|
|
21
|
+
try {
|
|
22
|
+
const result = _syncAction(...args);
|
|
23
|
+
cache.set(cacheKey, result);
|
|
24
|
+
return result;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("syncAction error:", error);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
12
30
|
//#endregion
|
|
13
31
|
//#region src/utils/nodes.ts
|
|
14
32
|
const isIdentifier = (0, _typescript_eslint_utils_ast_utils.isNodeOfType)(_typescript_eslint_utils.AST_NODE_TYPES.Identifier);
|
|
@@ -27,7 +45,6 @@ const isJSXIdentifier = (0, _typescript_eslint_utils_ast_utils.isNodeOfType)(_ty
|
|
|
27
45
|
const isCallExpression = (0, _typescript_eslint_utils_ast_utils.isNodeOfType)(_typescript_eslint_utils.AST_NODE_TYPES.CallExpression);
|
|
28
46
|
const isImportDeclaration = (0, _typescript_eslint_utils_ast_utils.isNodeOfType)(_typescript_eslint_utils.AST_NODE_TYPES.ImportDeclaration);
|
|
29
47
|
const isImportSpecifier = (0, _typescript_eslint_utils_ast_utils.isNodeOfType)(_typescript_eslint_utils.AST_NODE_TYPES.ImportSpecifier);
|
|
30
|
-
|
|
31
48
|
//#endregion
|
|
32
49
|
//#region src/utils/helpers.ts
|
|
33
50
|
const getAncestor = (ofType, for_) => {
|
|
@@ -80,7 +97,7 @@ const importsCache = /* @__PURE__ */ new WeakMap();
|
|
|
80
97
|
const getImports = (context) => {
|
|
81
98
|
if (importsCache.has(context)) return importsCache.get(context);
|
|
82
99
|
const imports = _getImports(context);
|
|
83
|
-
const result =
|
|
100
|
+
const result = syncAction("filterImports", getSyncOptions(context), imports) ?? [];
|
|
84
101
|
importsCache.set(context, result);
|
|
85
102
|
return result;
|
|
86
103
|
};
|
|
@@ -88,12 +105,12 @@ const isValidStyledProperty = (node, context) => {
|
|
|
88
105
|
return isJSXIdentifier(node) && isValidProperty(node.name, context);
|
|
89
106
|
};
|
|
90
107
|
const matchFile = (name, imports, context) => {
|
|
91
|
-
return
|
|
108
|
+
return syncAction("matchFile", getSyncOptions(context), name, imports);
|
|
92
109
|
};
|
|
93
110
|
const isBambooIsh = (name, context) => {
|
|
94
111
|
const imports = getImports(context);
|
|
95
112
|
if (imports.length === 0) return false;
|
|
96
|
-
const jsxFactory =
|
|
113
|
+
const jsxFactory = syncAction("getJsxFactory", getSyncOptions(context));
|
|
97
114
|
if (jsxFactory && name === jsxFactory) return imports.some((imp) => imp.name === name || imp.alias === name);
|
|
98
115
|
return matchFile(name, imports, context);
|
|
99
116
|
};
|
|
@@ -128,10 +145,10 @@ const isLocalStyledFactory = (node, context) => {
|
|
|
128
145
|
return true;
|
|
129
146
|
};
|
|
130
147
|
const isValidFile = (context) => {
|
|
131
|
-
return
|
|
148
|
+
return syncAction("isValidFile", getSyncOptions(context));
|
|
132
149
|
};
|
|
133
150
|
const isValidProperty = (name, context, calleName) => {
|
|
134
|
-
return
|
|
151
|
+
return syncAction("isValidProperty", getSyncOptions(context), name, calleName);
|
|
135
152
|
};
|
|
136
153
|
const isBambooImport = (node, context) => {
|
|
137
154
|
return getImports(context).some((imp) => imp.mod === node.source.value);
|
|
@@ -209,17 +226,17 @@ const isBambooAttribute = (node, context) => {
|
|
|
209
226
|
return isInJSXProp(node, context) && isStyledProperty(node, context);
|
|
210
227
|
};
|
|
211
228
|
const resolveLonghand = (name, context) => {
|
|
212
|
-
return
|
|
229
|
+
return syncAction("resolveLongHand", getSyncOptions(context), name);
|
|
213
230
|
};
|
|
214
231
|
const resolveShorthands = (name, context) => {
|
|
215
|
-
return
|
|
232
|
+
return syncAction("resolveShorthands", getSyncOptions(context), name);
|
|
216
233
|
};
|
|
217
234
|
const isColorAttribute = (attribute, context) => {
|
|
218
|
-
return
|
|
235
|
+
return syncAction("isColorAttribute", getSyncOptions(context), attribute);
|
|
219
236
|
};
|
|
220
237
|
const isColorToken = (value, context) => {
|
|
221
238
|
if (!value) return;
|
|
222
|
-
return
|
|
239
|
+
return syncAction("isColorToken", getSyncOptions(context), value);
|
|
223
240
|
};
|
|
224
241
|
const extractTokens = (value) => {
|
|
225
242
|
const regex = /token\(([^"'(),]+)(?:,\s*([^"'(),]+))?\)|\{([^\n\r{}]+)\}/g;
|
|
@@ -238,13 +255,13 @@ const getInvalidTokens = (value, context) => {
|
|
|
238
255
|
if (invalidTokensCache.has(value)) return invalidTokensCache.get(value);
|
|
239
256
|
const tokens = extractTokens(value);
|
|
240
257
|
if (!tokens.length) return [];
|
|
241
|
-
const invalidTokens =
|
|
258
|
+
const invalidTokens = syncAction("filterInvalidTokens", getSyncOptions(context), tokens);
|
|
242
259
|
invalidTokensCache.set(value, invalidTokens);
|
|
243
260
|
return invalidTokens;
|
|
244
261
|
};
|
|
245
262
|
const deprecatedTokensCache = /* @__PURE__ */ new Map();
|
|
246
263
|
const getDeprecatedTokens = (property, value, context) => {
|
|
247
|
-
const propertyCategory =
|
|
264
|
+
const propertyCategory = syncAction("getPropCategory", getSyncOptions(context), property);
|
|
248
265
|
const tokens = extractTokens(value);
|
|
249
266
|
if (!propertyCategory && !tokens.length) return [];
|
|
250
267
|
const values = tokens.length ? tokens : [{
|
|
@@ -252,7 +269,7 @@ const getDeprecatedTokens = (property, value, context) => {
|
|
|
252
269
|
value: value.split("/")[0]
|
|
253
270
|
}];
|
|
254
271
|
if (deprecatedTokensCache.has(value)) return deprecatedTokensCache.get(value);
|
|
255
|
-
const deprecatedTokens =
|
|
272
|
+
const deprecatedTokens = syncAction("filterDeprecatedTokens", getSyncOptions(context), values);
|
|
256
273
|
deprecatedTokensCache.set(value, deprecatedTokens);
|
|
257
274
|
return deprecatedTokens;
|
|
258
275
|
};
|
|
@@ -290,11 +307,10 @@ function isRecipeVariant(node, context) {
|
|
|
290
307
|
}
|
|
291
308
|
if (length < (caller === "cva" ? 2 : 4) + (styleObjectParent === "base" ? 0 : 4)) return true;
|
|
292
309
|
}
|
|
293
|
-
|
|
294
310
|
//#endregion
|
|
295
311
|
//#region src/rules/file-not-included.ts
|
|
296
312
|
const RULE_NAME$18 = "file-not-included";
|
|
297
|
-
const rule$18 =
|
|
313
|
+
const rule$18 = createRule({
|
|
298
314
|
create(context) {
|
|
299
315
|
if (isValidFile(context)) return {};
|
|
300
316
|
let hasReported = false;
|
|
@@ -317,7 +333,6 @@ const rule$18 = require_utils.createRule({
|
|
|
317
333
|
},
|
|
318
334
|
name: RULE_NAME$18
|
|
319
335
|
});
|
|
320
|
-
|
|
321
336
|
//#endregion
|
|
322
337
|
//#region src/rules/no-config-function-in-source.ts
|
|
323
338
|
const RULE_NAME$17 = "no-config-function-in-source";
|
|
@@ -337,7 +352,7 @@ const CONFIG_FUNCTIONS = new Set([
|
|
|
337
352
|
"defineTokens",
|
|
338
353
|
"defineUtility"
|
|
339
354
|
]);
|
|
340
|
-
const rule$17 =
|
|
355
|
+
const rule$17 = createRule({
|
|
341
356
|
create(context) {
|
|
342
357
|
if (!hasPkgImport(context)) return {};
|
|
343
358
|
if (!isValidFile(context)) return {};
|
|
@@ -379,11 +394,10 @@ const rule$17 = require_utils.createRule({
|
|
|
379
394
|
},
|
|
380
395
|
name: RULE_NAME$17
|
|
381
396
|
});
|
|
382
|
-
|
|
383
397
|
//#endregion
|
|
384
398
|
//#region src/rules/no-debug.ts
|
|
385
399
|
const RULE_NAME$16 = "no-debug";
|
|
386
|
-
const rule$16 =
|
|
400
|
+
const rule$16 = createRule({
|
|
387
401
|
create(context) {
|
|
388
402
|
const processedNodes = /* @__PURE__ */ new WeakSet();
|
|
389
403
|
const checkObjectForDebug = (object) => {
|
|
@@ -454,11 +468,10 @@ const rule$16 = require_utils.createRule({
|
|
|
454
468
|
},
|
|
455
469
|
name: RULE_NAME$16
|
|
456
470
|
});
|
|
457
|
-
|
|
458
471
|
//#endregion
|
|
459
472
|
//#region src/rules/no-deprecated-tokens.ts
|
|
460
473
|
const RULE_NAME$15 = "no-deprecated-tokens";
|
|
461
|
-
const rule$15 =
|
|
474
|
+
const rule$15 = createRule({
|
|
462
475
|
create(context) {
|
|
463
476
|
const deprecatedTokensCache = /* @__PURE__ */ new Map();
|
|
464
477
|
const sendReport = (property, node, value) => {
|
|
@@ -514,11 +527,10 @@ const rule$15 = require_utils.createRule({
|
|
|
514
527
|
},
|
|
515
528
|
name: RULE_NAME$15
|
|
516
529
|
});
|
|
517
|
-
|
|
518
530
|
//#endregion
|
|
519
531
|
//#region src/rules/no-dynamic-styling.ts
|
|
520
532
|
const RULE_NAME$14 = "no-dynamic-styling";
|
|
521
|
-
const rule$14 =
|
|
533
|
+
const rule$14 = createRule({
|
|
522
534
|
create(context) {
|
|
523
535
|
function isStaticValue(node) {
|
|
524
536
|
if (!node) return false;
|
|
@@ -591,11 +603,10 @@ const rule$14 = require_utils.createRule({
|
|
|
591
603
|
},
|
|
592
604
|
name: RULE_NAME$14
|
|
593
605
|
});
|
|
594
|
-
|
|
595
606
|
//#endregion
|
|
596
607
|
//#region src/rules/no-escape-hatch.ts
|
|
597
608
|
const RULE_NAME$13 = "no-escape-hatch";
|
|
598
|
-
const rule$13 =
|
|
609
|
+
const rule$13 = createRule({
|
|
599
610
|
create(context) {
|
|
600
611
|
const removeBrackets = (range) => {
|
|
601
612
|
const [start, end] = range;
|
|
@@ -660,11 +671,10 @@ const rule$13 = require_utils.createRule({
|
|
|
660
671
|
},
|
|
661
672
|
name: RULE_NAME$13
|
|
662
673
|
});
|
|
663
|
-
|
|
664
674
|
//#endregion
|
|
665
675
|
//#region src/rules/no-hardcoded-color.ts
|
|
666
676
|
const RULE_NAME$12 = "no-hardcoded-color";
|
|
667
|
-
const rule$12 =
|
|
677
|
+
const rule$12 = createRule({
|
|
668
678
|
create(context) {
|
|
669
679
|
const noOpacity = context.options[0]?.noOpacity;
|
|
670
680
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
@@ -762,13 +772,12 @@ const rule$12 = require_utils.createRule({
|
|
|
762
772
|
},
|
|
763
773
|
name: RULE_NAME$12
|
|
764
774
|
});
|
|
765
|
-
|
|
766
775
|
//#endregion
|
|
767
776
|
//#region src/rules/no-important.ts
|
|
768
777
|
const exclamationRegex = /\s*!$/;
|
|
769
778
|
const importantRegex = /\s*!important\s*$/;
|
|
770
779
|
const RULE_NAME$11 = "no-important";
|
|
771
|
-
const rule$11 =
|
|
780
|
+
const rule$11 = createRule({
|
|
772
781
|
create(context) {
|
|
773
782
|
const removeQuotes = (range) => {
|
|
774
783
|
const [start, end] = range;
|
|
@@ -874,11 +883,10 @@ const rule$11 = require_utils.createRule({
|
|
|
874
883
|
},
|
|
875
884
|
name: RULE_NAME$11
|
|
876
885
|
});
|
|
877
|
-
|
|
878
886
|
//#endregion
|
|
879
887
|
//#region src/rules/no-invalid-nesting.ts
|
|
880
888
|
const RULE_NAME$10 = "no-invalid-nesting";
|
|
881
|
-
const rule$10 =
|
|
889
|
+
const rule$10 = createRule({
|
|
882
890
|
create(context) {
|
|
883
891
|
const bambooFunctionCache = /* @__PURE__ */ new WeakMap();
|
|
884
892
|
const jsxPropertyCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -935,11 +943,10 @@ const rule$10 = require_utils.createRule({
|
|
|
935
943
|
},
|
|
936
944
|
name: RULE_NAME$10
|
|
937
945
|
});
|
|
938
|
-
|
|
939
946
|
//#endregion
|
|
940
947
|
//#region src/rules/no-invalid-token-paths.ts
|
|
941
948
|
const RULE_NAME$9 = "no-invalid-token-paths";
|
|
942
|
-
const rule$9 =
|
|
949
|
+
const rule$9 = createRule({
|
|
943
950
|
create(context) {
|
|
944
951
|
const invalidTokensCache = /* @__PURE__ */ new Map();
|
|
945
952
|
const sendReport = (node, value) => {
|
|
@@ -1018,11 +1025,10 @@ const rule$9 = require_utils.createRule({
|
|
|
1018
1025
|
},
|
|
1019
1026
|
name: RULE_NAME$9
|
|
1020
1027
|
});
|
|
1021
|
-
|
|
1022
1028
|
//#endregion
|
|
1023
1029
|
//#region src/rules/no-margin-properties.ts
|
|
1024
1030
|
const RULE_NAME$8 = "no-margin-properties";
|
|
1025
|
-
const rule$8 =
|
|
1031
|
+
const rule$8 = createRule({
|
|
1026
1032
|
create(context) {
|
|
1027
1033
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
1028
1034
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
@@ -1100,7 +1106,6 @@ const rule$8 = require_utils.createRule({
|
|
|
1100
1106
|
},
|
|
1101
1107
|
name: RULE_NAME$8
|
|
1102
1108
|
});
|
|
1103
|
-
|
|
1104
1109
|
//#endregion
|
|
1105
1110
|
//#region src/utils/physical-properties.ts
|
|
1106
1111
|
const physicalProperties = {
|
|
@@ -1141,7 +1146,6 @@ const physicalPropertyValues = { textAlign: {
|
|
|
1141
1146
|
left: "start",
|
|
1142
1147
|
right: "end"
|
|
1143
1148
|
} };
|
|
1144
|
-
|
|
1145
1149
|
//#endregion
|
|
1146
1150
|
//#region src/rules/no-physical-properties.ts
|
|
1147
1151
|
const RULE_NAME$7 = "no-physical-properties";
|
|
@@ -1226,7 +1230,7 @@ const createValueReport = (valueNode, valueText, logical, context) => {
|
|
|
1226
1230
|
}]
|
|
1227
1231
|
});
|
|
1228
1232
|
};
|
|
1229
|
-
const rule$7 =
|
|
1233
|
+
const rule$7 = createRule({
|
|
1230
1234
|
create(context) {
|
|
1231
1235
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
1232
1236
|
const cache = new PropertyCache();
|
|
@@ -1284,11 +1288,10 @@ const rule$7 = require_utils.createRule({
|
|
|
1284
1288
|
},
|
|
1285
1289
|
name: RULE_NAME$7
|
|
1286
1290
|
});
|
|
1287
|
-
|
|
1288
1291
|
//#endregion
|
|
1289
1292
|
//#region src/rules/no-property-renaming.ts
|
|
1290
1293
|
const RULE_NAME$6 = "no-property-renaming";
|
|
1291
|
-
const rule$6 =
|
|
1294
|
+
const rule$6 = createRule({
|
|
1292
1295
|
create(context) {
|
|
1293
1296
|
const bambooPropertyCache = /* @__PURE__ */ new WeakMap();
|
|
1294
1297
|
const bambooAttributeCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -1354,11 +1357,10 @@ const rule$6 = require_utils.createRule({
|
|
|
1354
1357
|
},
|
|
1355
1358
|
name: RULE_NAME$6
|
|
1356
1359
|
});
|
|
1357
|
-
|
|
1358
1360
|
//#endregion
|
|
1359
1361
|
//#region src/rules/no-unsafe-token-fn-usage.ts
|
|
1360
1362
|
const RULE_NAME$5 = "no-unsafe-token-fn-usage";
|
|
1361
|
-
const rule$5 =
|
|
1363
|
+
const rule$5 = createRule({
|
|
1362
1364
|
create(context) {
|
|
1363
1365
|
let tokenImportCache;
|
|
1364
1366
|
const getCachedTokenImport = () => {
|
|
@@ -1466,7 +1468,6 @@ const rule$5 = require_utils.createRule({
|
|
|
1466
1468
|
},
|
|
1467
1469
|
name: RULE_NAME$5
|
|
1468
1470
|
});
|
|
1469
|
-
|
|
1470
1471
|
//#endregion
|
|
1471
1472
|
//#region src/utils/composite-properties.ts
|
|
1472
1473
|
const compositeProperties = {
|
|
@@ -1725,11 +1726,10 @@ const compositeProperties = {
|
|
|
1725
1726
|
"transitionDelay"
|
|
1726
1727
|
]
|
|
1727
1728
|
};
|
|
1728
|
-
|
|
1729
1729
|
//#endregion
|
|
1730
1730
|
//#region src/rules/prefer-atomic-properties.ts
|
|
1731
1731
|
const RULE_NAME$4 = "prefer-atomic-properties";
|
|
1732
|
-
const rule$4 =
|
|
1732
|
+
const rule$4 = createRule({
|
|
1733
1733
|
create(context) {
|
|
1734
1734
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
1735
1735
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
@@ -1824,11 +1824,10 @@ const rule$4 = require_utils.createRule({
|
|
|
1824
1824
|
},
|
|
1825
1825
|
name: RULE_NAME$4
|
|
1826
1826
|
});
|
|
1827
|
-
|
|
1828
1827
|
//#endregion
|
|
1829
1828
|
//#region src/rules/prefer-composite-properties.ts
|
|
1830
1829
|
const RULE_NAME$3 = "prefer-composite-properties";
|
|
1831
|
-
const rule$3 =
|
|
1830
|
+
const rule$3 = createRule({
|
|
1832
1831
|
create(context) {
|
|
1833
1832
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
1834
1833
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
@@ -1920,11 +1919,10 @@ const rule$3 = require_utils.createRule({
|
|
|
1920
1919
|
},
|
|
1921
1920
|
name: RULE_NAME$3
|
|
1922
1921
|
});
|
|
1923
|
-
|
|
1924
1922
|
//#endregion
|
|
1925
1923
|
//#region src/rules/prefer-longhand-properties.ts
|
|
1926
1924
|
const RULE_NAME$2 = "prefer-longhand-properties";
|
|
1927
|
-
const rule$2 =
|
|
1925
|
+
const rule$2 = createRule({
|
|
1928
1926
|
create(context) {
|
|
1929
1927
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
1930
1928
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
@@ -2012,11 +2010,10 @@ const rule$2 = require_utils.createRule({
|
|
|
2012
2010
|
},
|
|
2013
2011
|
name: RULE_NAME$2
|
|
2014
2012
|
});
|
|
2015
|
-
|
|
2016
2013
|
//#endregion
|
|
2017
2014
|
//#region src/rules/prefer-shorthand-properties.ts
|
|
2018
2015
|
const RULE_NAME$1 = "prefer-shorthand-properties";
|
|
2019
|
-
const rule$1 =
|
|
2016
|
+
const rule$1 = createRule({
|
|
2020
2017
|
create(context) {
|
|
2021
2018
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
2022
2019
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
@@ -2113,11 +2110,10 @@ const rule$1 = require_utils.createRule({
|
|
|
2113
2110
|
},
|
|
2114
2111
|
name: RULE_NAME$1
|
|
2115
2112
|
});
|
|
2116
|
-
|
|
2117
2113
|
//#endregion
|
|
2118
2114
|
//#region src/rules/prefer-unified-property-style.ts
|
|
2119
2115
|
const RULE_NAME = "prefer-unified-property-style";
|
|
2120
|
-
const rule =
|
|
2116
|
+
const rule = createRule({
|
|
2121
2117
|
create(context) {
|
|
2122
2118
|
const longhandCache = /* @__PURE__ */ new Map();
|
|
2123
2119
|
const getLonghand = (name) => {
|
|
@@ -2206,7 +2202,6 @@ const rule = require_utils.createRule({
|
|
|
2206
2202
|
},
|
|
2207
2203
|
name: RULE_NAME
|
|
2208
2204
|
});
|
|
2209
|
-
|
|
2210
2205
|
//#endregion
|
|
2211
2206
|
//#region src/rules/index.ts
|
|
2212
2207
|
const rules = {
|
|
@@ -2230,7 +2225,6 @@ const rules = {
|
|
|
2230
2225
|
[RULE_NAME$1]: rule$1,
|
|
2231
2226
|
[RULE_NAME]: rule
|
|
2232
2227
|
};
|
|
2233
|
-
|
|
2234
2228
|
//#endregion
|
|
2235
2229
|
//#region src/configs/all.ts
|
|
2236
2230
|
const errorRules = [
|
|
@@ -2238,42 +2232,35 @@ const errorRules = [
|
|
|
2238
2232
|
RULE_NAME$17,
|
|
2239
2233
|
RULE_NAME$9
|
|
2240
2234
|
];
|
|
2241
|
-
const allRules = Object.fromEntries(Object.entries(rules).map(([name]) => {
|
|
2242
|
-
return [`bamboo/${name}`, errorRules.includes(name) ? "error" : "warn"];
|
|
2243
|
-
}));
|
|
2244
|
-
var all_default = {
|
|
2245
|
-
parser: "@typescript-eslint/parser",
|
|
2246
|
-
parserOptions: { sourceType: "module" },
|
|
2247
|
-
plugins: ["bamboo"],
|
|
2248
|
-
rules: allRules
|
|
2249
|
-
};
|
|
2250
|
-
|
|
2251
|
-
//#endregion
|
|
2252
|
-
//#region src/configs/recommended.ts
|
|
2253
|
-
var recommended_default = {
|
|
2254
|
-
parser: "@typescript-eslint/parser",
|
|
2255
|
-
parserOptions: { sourceType: "module" },
|
|
2256
|
-
plugins: ["bamboo"],
|
|
2257
|
-
rules: {
|
|
2258
|
-
"bamboo/file-not-included": "error",
|
|
2259
|
-
"bamboo/no-config-function-in-source": "error",
|
|
2260
|
-
"bamboo/no-debug": "warn",
|
|
2261
|
-
"bamboo/no-deprecated-tokens": "warn",
|
|
2262
|
-
"bamboo/no-dynamic-styling": "warn",
|
|
2263
|
-
"bamboo/no-hardcoded-color": "warn",
|
|
2264
|
-
"bamboo/no-invalid-nesting": "error",
|
|
2265
|
-
"bamboo/no-invalid-token-paths": "error",
|
|
2266
|
-
"bamboo/no-property-renaming": "warn",
|
|
2267
|
-
"bamboo/no-unsafe-token-fn-usage": "warn"
|
|
2268
|
-
}
|
|
2269
|
-
};
|
|
2270
|
-
|
|
2271
2235
|
//#endregion
|
|
2272
2236
|
//#region src/index.ts
|
|
2273
2237
|
const plugin = {
|
|
2274
2238
|
configs: {
|
|
2275
|
-
all:
|
|
2276
|
-
|
|
2239
|
+
all: {
|
|
2240
|
+
parser: "@typescript-eslint/parser",
|
|
2241
|
+
parserOptions: { sourceType: "module" },
|
|
2242
|
+
plugins: ["bamboo"],
|
|
2243
|
+
rules: Object.fromEntries(Object.entries(rules).map(([name]) => {
|
|
2244
|
+
return [`bamboo/${name}`, errorRules.includes(name) ? "error" : "warn"];
|
|
2245
|
+
}))
|
|
2246
|
+
},
|
|
2247
|
+
recommended: {
|
|
2248
|
+
parser: "@typescript-eslint/parser",
|
|
2249
|
+
parserOptions: { sourceType: "module" },
|
|
2250
|
+
plugins: ["bamboo"],
|
|
2251
|
+
rules: {
|
|
2252
|
+
"bamboo/file-not-included": "error",
|
|
2253
|
+
"bamboo/no-config-function-in-source": "error",
|
|
2254
|
+
"bamboo/no-debug": "warn",
|
|
2255
|
+
"bamboo/no-deprecated-tokens": "warn",
|
|
2256
|
+
"bamboo/no-dynamic-styling": "warn",
|
|
2257
|
+
"bamboo/no-hardcoded-color": "warn",
|
|
2258
|
+
"bamboo/no-invalid-nesting": "error",
|
|
2259
|
+
"bamboo/no-invalid-token-paths": "error",
|
|
2260
|
+
"bamboo/no-property-renaming": "warn",
|
|
2261
|
+
"bamboo/no-unsafe-token-fn-usage": "warn"
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2277
2264
|
},
|
|
2278
2265
|
meta: {
|
|
2279
2266
|
name,
|
|
@@ -2281,7 +2268,5 @@ const plugin = {
|
|
|
2281
2268
|
},
|
|
2282
2269
|
rules
|
|
2283
2270
|
};
|
|
2284
|
-
module.exports = plugin;
|
|
2285
|
-
|
|
2286
2271
|
//#endregion
|
|
2287
|
-
|
|
2272
|
+
module.exports = plugin;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const plugin: {
|
|
3
|
+
configs: {
|
|
4
|
+
all: {
|
|
5
|
+
parser: string;
|
|
6
|
+
parserOptions: {
|
|
7
|
+
sourceType: string;
|
|
8
|
+
};
|
|
9
|
+
plugins: string[];
|
|
10
|
+
rules: {
|
|
11
|
+
[k: string]: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
recommended: {
|
|
15
|
+
parser: string;
|
|
16
|
+
parserOptions: {
|
|
17
|
+
sourceType: string;
|
|
18
|
+
};
|
|
19
|
+
plugins: string[];
|
|
20
|
+
rules: {
|
|
21
|
+
'bamboo/file-not-included': string;
|
|
22
|
+
'bamboo/no-config-function-in-source': string;
|
|
23
|
+
'bamboo/no-debug': string;
|
|
24
|
+
'bamboo/no-deprecated-tokens': string;
|
|
25
|
+
'bamboo/no-dynamic-styling': string;
|
|
26
|
+
'bamboo/no-hardcoded-color': string;
|
|
27
|
+
'bamboo/no-invalid-nesting': string;
|
|
28
|
+
'bamboo/no-invalid-token-paths': string;
|
|
29
|
+
'bamboo/no-property-renaming': string;
|
|
30
|
+
'bamboo/no-unsafe-token-fn-usage': string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
meta: {
|
|
35
|
+
name: string;
|
|
36
|
+
version: string;
|
|
37
|
+
};
|
|
38
|
+
rules: any;
|
|
39
|
+
};
|
|
40
|
+
export = plugin;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const plugin: {
|
|
3
|
+
configs: {
|
|
4
|
+
all: {
|
|
5
|
+
parser: string;
|
|
6
|
+
parserOptions: {
|
|
7
|
+
sourceType: string;
|
|
8
|
+
};
|
|
9
|
+
plugins: string[];
|
|
10
|
+
rules: {
|
|
11
|
+
[k: string]: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
recommended: {
|
|
15
|
+
parser: string;
|
|
16
|
+
parserOptions: {
|
|
17
|
+
sourceType: string;
|
|
18
|
+
};
|
|
19
|
+
plugins: string[];
|
|
20
|
+
rules: {
|
|
21
|
+
'bamboo/file-not-included': string;
|
|
22
|
+
'bamboo/no-config-function-in-source': string;
|
|
23
|
+
'bamboo/no-debug': string;
|
|
24
|
+
'bamboo/no-deprecated-tokens': string;
|
|
25
|
+
'bamboo/no-dynamic-styling': string;
|
|
26
|
+
'bamboo/no-hardcoded-color': string;
|
|
27
|
+
'bamboo/no-invalid-nesting': string;
|
|
28
|
+
'bamboo/no-invalid-token-paths': string;
|
|
29
|
+
'bamboo/no-property-renaming': string;
|
|
30
|
+
'bamboo/no-unsafe-token-fn-usage': string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
meta: {
|
|
35
|
+
name: string;
|
|
36
|
+
version: string;
|
|
37
|
+
};
|
|
38
|
+
rules: any;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { plugin as default };
|