@lark-apaas/fullstack-presets 1.1.10 → 1.1.11

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.
@@ -66,6 +66,23 @@ exports.looseRestrictSyntaxRules = [
66
66
  selector: 'JSXAttribute[name.name="className"][value.value=/\\[rgb\\([^\\]]*\\s[^\\]]*\\)/]',
67
67
  message: 'Tailwind 4 arbitrary values cannot contain spaces. Replace spaces with underscores in rgb() values. Example: bg-[rgb(255_255_255)] instead of bg-[rgb(255 255 255)]',
68
68
  },
69
+ // 阻止模型引用 @shared/static 与 shared/static 的字符串
70
+ {
71
+ selector: 'Literal[value=/^@shared\\u002Fstatic/]:not(ImportDeclaration > Literal):not(ExportAllDeclaration > Literal):not(ExportNamedDeclaration > Literal):not(ImportExpression > Literal)',
72
+ message: "Do not use '@shared/static/*' or 'shared/static/*' as a raw string (e.g. in fetch, image src, etc.). Shared static assets must be accessed via import statements.",
73
+ },
74
+ {
75
+ selector: 'TemplateLiteral[expressions.length=0] > TemplateElement[value.raw=/^@shared\\u002Fstatic/]',
76
+ message: "Do not use '@shared/static/*' or 'shared/static/*' as a raw string (e.g. in fetch, image src, etc.). Shared static assets must be accessed via import statements.",
77
+ },
78
+ {
79
+ selector: 'Literal[value=/^shared\\u002Fstatic/]:not(ImportDeclaration > Literal):not(ExportAllDeclaration > Literal):not(ExportNamedDeclaration > Literal):not(ImportExpression > Literal)',
80
+ message: "Do not use '@shared/static/*' or 'shared/static/*' as a raw string (e.g. in fetch, image src, etc.). Shared static assets must be accessed via import statements.",
81
+ },
82
+ {
83
+ selector: 'TemplateLiteral[expressions.length=0] > TemplateElement[value.raw=/^shared\\u002Fstatic/]',
84
+ message: "Do not use '@shared/static/*' or 'shared/static/*' as a raw string (e.g. in fetch, image src, etc.). Shared static assets must be accessed via import statements.",
85
+ },
69
86
  ];
70
87
  // 严格语法规则:仅正常模式启用,loose 模式下不启用
71
88
  const strictSyntaxRules = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-presets",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "files": [
5
5
  "lib"
6
6
  ],