@ai-i18n/eslint-plugin 1.0.0-alpha.7 → 1.0.0-alpha.8
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/README.md +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -102,13 +102,16 @@ function SaveButton() {
|
|
|
102
102
|
|
|
103
103
|
规则与 Vite 共用静态参数语义,包括从 `useI18n()` 获得的对象成员调用
|
|
104
104
|
`i18n.t()`、`i18n['t']()`、省略式 `t('source', undefined)` 和 tagged template。
|
|
105
|
+
整棵可静态求值的纯文案对象或数组可以直接传给 `t()` 或 Vue `tRef()`,不要求
|
|
106
|
+
`defineI18nMessages()` 或 `as const`;规则会按去重后的字符串叶子计算静态候选数。
|
|
105
107
|
Vue 模板必须在 `<script setup>` 中绑定 `useI18n()` 返回的 `t`;自动导入只省略 import,
|
|
106
108
|
不会自动合成 Hook。`vue-auto-import` 会把裸 template-only `t()` 作为 error;模板中已
|
|
107
109
|
绑定到 Runtime 顶层 `t` 的调用则由 `no-unsubscribed-t` warning。
|
|
108
110
|
在 template 或 JSX/TSX 渲染期间调用 `tRef()` 会重复创建 `computed`,同一规则会提示在
|
|
109
111
|
Vue setup 中只创建一次并使用返回的 Ref。
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
对象或数组的成员级引用只有在根集合由 `defineI18nMessages()` 标记后才属于推荐写法。
|
|
114
|
+
动态生成的树、非普通对象以及带第二参数的整树调用会报错。字符串拼接、
|
|
112
115
|
逻辑表达式、`let` 文案、普通集合成员、`const tr = t`、命名空间调用、二次 Hook 解构、
|
|
113
116
|
`useI18n().t()` 与 `require()` 都会报错。
|
|
114
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-i18n/eslint-plugin",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"description": "ESLint static-argument checks aligned with ai-i18n extraction semantics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ai-i18n/analyzer": "^1.0.0-alpha.
|
|
36
|
+
"@ai-i18n/analyzer": "^1.0.0-alpha.7"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@vue/compiler-sfc": ">=3.2.0",
|