@lark-apaas/fullstack-presets 1.0.0 → 1.0.2

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.
@@ -57,6 +57,17 @@ exports.default = {
57
57
  'no-constant-binary-expression': 'off', // 不强制使用常量二进制表达式
58
58
  // React Refresh 相关 - 开发时不影响渲染的检测
59
59
  'react-refresh/only-export-components': 'off',
60
+ 'no-restricted-imports': [
61
+ 'error',
62
+ {
63
+ paths: [
64
+ {
65
+ name: 'next/link',
66
+ message: "Importing from 'next/link' is prohibited. Please use the `Link` component from 'react-router-dom' for navigation.",
67
+ },
68
+ ],
69
+ },
70
+ ],
60
71
  'no-restricted-syntax': [
61
72
  'error',
62
73
  // 限制使用 fetch(推荐使用生成的 API Client)
@@ -86,6 +97,21 @@ exports.default = {
86
97
  message: "Please don't use confirm. It may conflict with window.confirm BOM method, use `Dialog` component instead for better user experience and consistency",
87
98
  selector: "CallExpression[callee.name='confirm']",
88
99
  },
100
+ // 禁用`window.location.href`赋值使用,可以读取
101
+ {
102
+ selector: 'AssignmentExpression[left.object.object.name="window"][left.object.property.name="location"][left.property.name="href"]',
103
+ message: "Please don't use `window.location.href` to navigate. Use `useNavigate` hook from 'react-router-dom' instead.",
104
+ },
105
+ // 禁止`location.href`赋值使用,可以读取
106
+ {
107
+ selector: 'AssignmentExpression[left.object.name="location"][left.property.name="href"]',
108
+ message: "Please don't use `location.href` to navigate. Use `useNavigate` hook from 'react-router-dom' instead.",
109
+ },
110
+ // SelectItem组件的value属性值不能为空字符串
111
+ {
112
+ message: 'The `value` attribute of the `SelectItem` component cannot be an empty string.',
113
+ selector: 'JSXOpeningElement[name.name="SelectItem"]:has(JSXAttribute[name.name="value"][value.value=""]), JSXOpeningElement[name.name="SelectItem"]:has(JSXAttribute[name.name="value"][value.expression.value=""])',
114
+ },
89
115
  ],
90
116
  },
91
117
  };
@@ -41,6 +41,9 @@ declare const _default: {
41
41
  '@darraghor/nestjs-typed/injectable-should-be-provided': (string | {
42
42
  src: string[];
43
43
  })[];
44
+ '@darraghor/nestjs-typed/api-property-returning-array-should-set-array': string;
45
+ '@darraghor/nestjs-typed/api-property-matches-property-optionality': string;
46
+ '@darraghor/nestjs-typed/all-properties-are-whitelisted': string;
44
47
  };
45
48
  };
46
49
  export default _default;
@@ -61,5 +61,8 @@ exports.default = {
61
61
  src: ['./server/**/*.ts'],
62
62
  },
63
63
  ],
64
+ '@darraghor/nestjs-typed/api-property-returning-array-should-set-array': 'off',
65
+ '@darraghor/nestjs-typed/api-property-matches-property-optionality': 'off',
66
+ '@darraghor/nestjs-typed/all-properties-are-whitelisted': 'off',
64
67
  },
65
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-presets",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "files": [
5
5
  "lib"
6
6
  ],