@intlayer/docs 9.3.2 → 9.3.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.
Files changed (115) hide show
  1. package/blog/ar/nextjs-multilingual-seo-comparison.md +10 -10
  2. package/blog/de/nextjs-multilingual-seo-comparison.md +9 -9
  3. package/blog/en/nextjs-multilingual-seo-comparison.md +10 -10
  4. package/blog/en-GB/nextjs-multilingual-seo-comparison.md +10 -10
  5. package/blog/es/nextjs-multilingual-seo-comparison.md +10 -10
  6. package/blog/fr/nextjs-multilingual-seo-comparison.md +10 -10
  7. package/blog/hi/nextjs-multilingual-seo-comparison.md +10 -10
  8. package/blog/id/nextjs-multilingual-seo-comparison.md +10 -10
  9. package/blog/it/nextjs-multilingual-seo-comparison.md +10 -10
  10. package/blog/ja/nextjs-multilingual-seo-comparison.md +9 -9
  11. package/blog/ko/nextjs-multilingual-seo-comparison.md +9 -9
  12. package/blog/pl/nextjs-multilingual-seo-comparison.md +10 -10
  13. package/blog/pt/nextjs-multilingual-seo-comparison.md +9 -9
  14. package/blog/ru/nextjs-multilingual-seo-comparison.md +9 -9
  15. package/blog/tr/nextjs-multilingual-seo-comparison.md +9 -9
  16. package/blog/uk/nextjs-multilingual-seo-comparison.md +10 -10
  17. package/blog/vi/nextjs-multilingual-seo-comparison.md +10 -10
  18. package/blog/zh/nextjs-multilingual-seo-comparison.md +10 -10
  19. package/docs/ar/bundle_optimization.md +1 -1
  20. package/docs/ar/configuration.md +32 -9
  21. package/docs/ar/dictionary/content_file.md +0 -22
  22. package/docs/ar/dictionary/function_fetching.md +23 -0
  23. package/docs/ar/eslint.md +9 -9
  24. package/docs/bn/configuration.md +34 -9
  25. package/docs/bn/eslint.md +9 -9
  26. package/docs/cs/bundle_optimization.md +1 -1
  27. package/docs/cs/configuration.md +33 -9
  28. package/docs/cs/eslint.md +9 -9
  29. package/docs/de/bundle_optimization.md +1 -1
  30. package/docs/de/configuration.md +34 -9
  31. package/docs/de/dictionary/content_file.md +0 -22
  32. package/docs/de/dictionary/function_fetching.md +23 -0
  33. package/docs/de/eslint.md +9 -9
  34. package/docs/en/bundle_optimization.md +1 -1
  35. package/docs/en/configuration.md +34 -9
  36. package/docs/en/dictionary/content_file.md +0 -22
  37. package/docs/en/dictionary/function_fetching.md +23 -0
  38. package/docs/en/eslint.md +9 -9
  39. package/docs/en/packages/intlayer/getLocalizedPath.md +70 -19
  40. package/docs/en-GB/configuration.md +33 -9
  41. package/docs/en-GB/dictionary/content_file.md +0 -22
  42. package/docs/en-GB/dictionary/function_fetching.md +23 -0
  43. package/docs/en-GB/eslint.md +9 -9
  44. package/docs/es/bundle_optimization.md +1 -1
  45. package/docs/es/configuration.md +35 -9
  46. package/docs/es/dictionary/content_file.md +0 -22
  47. package/docs/es/dictionary/function_fetching.md +23 -0
  48. package/docs/es/eslint.md +9 -9
  49. package/docs/fr/bundle_optimization.md +1 -1
  50. package/docs/fr/configuration.md +35 -9
  51. package/docs/fr/dictionary/content_file.md +0 -22
  52. package/docs/fr/dictionary/function_fetching.md +23 -0
  53. package/docs/fr/eslint.md +9 -9
  54. package/docs/hi/configuration.md +35 -9
  55. package/docs/hi/dictionary/content_file.md +0 -22
  56. package/docs/hi/dictionary/function_fetching.md +23 -0
  57. package/docs/hi/eslint.md +9 -9
  58. package/docs/id/configuration.md +35 -9
  59. package/docs/id/dictionary/content_file.md +0 -22
  60. package/docs/id/dictionary/function_fetching.md +23 -0
  61. package/docs/id/eslint.md +9 -9
  62. package/docs/it/bundle_optimization.md +1 -1
  63. package/docs/it/configuration.md +35 -9
  64. package/docs/it/dictionary/content_file.md +0 -22
  65. package/docs/it/dictionary/function_fetching.md +23 -0
  66. package/docs/it/eslint.md +9 -9
  67. package/docs/ja/configuration.md +30 -9
  68. package/docs/ja/dictionary/content_file.md +0 -22
  69. package/docs/ja/dictionary/function_fetching.md +23 -0
  70. package/docs/ja/eslint.md +9 -9
  71. package/docs/ko/configuration.md +31 -9
  72. package/docs/ko/dictionary/content_file.md +0 -22
  73. package/docs/ko/dictionary/function_fetching.md +23 -0
  74. package/docs/ko/eslint.md +9 -9
  75. package/docs/nl/configuration.md +33 -9
  76. package/docs/nl/eslint.md +9 -9
  77. package/docs/pl/bundle_optimization.md +1 -1
  78. package/docs/pl/configuration.md +34 -9
  79. package/docs/pl/dictionary/content_file.md +0 -22
  80. package/docs/pl/dictionary/function_fetching.md +23 -0
  81. package/docs/pl/eslint.md +9 -9
  82. package/docs/pt/bundle_optimization.md +1 -1
  83. package/docs/pt/configuration.md +34 -9
  84. package/docs/pt/dictionary/content_file.md +0 -22
  85. package/docs/pt/dictionary/function_fetching.md +23 -0
  86. package/docs/pt/eslint.md +9 -9
  87. package/docs/ru/bundle_optimization.md +1 -1
  88. package/docs/ru/configuration.md +34 -9
  89. package/docs/ru/dictionary/content_file.md +0 -22
  90. package/docs/ru/dictionary/function_fetching.md +23 -0
  91. package/docs/ru/eslint.md +9 -9
  92. package/docs/tr/bundle_optimization.md +1 -1
  93. package/docs/tr/configuration.md +33 -9
  94. package/docs/tr/dictionary/content_file.md +0 -22
  95. package/docs/tr/dictionary/function_fetching.md +23 -0
  96. package/docs/tr/eslint.md +9 -9
  97. package/docs/uk/configuration.md +35 -9
  98. package/docs/uk/dictionary/content_file.md +0 -22
  99. package/docs/uk/dictionary/function_fetching.md +23 -0
  100. package/docs/uk/eslint.md +9 -9
  101. package/docs/ur/configuration.md +35 -9
  102. package/docs/ur/eslint.md +9 -9
  103. package/docs/vi/bundle_optimization.md +1 -1
  104. package/docs/vi/configuration.md +33 -9
  105. package/docs/vi/dictionary/content_file.md +0 -22
  106. package/docs/vi/dictionary/function_fetching.md +23 -0
  107. package/docs/vi/eslint.md +9 -9
  108. package/docs/zh/bundle_optimization.md +1 -1
  109. package/docs/zh/configuration.md +29 -9
  110. package/docs/zh/dictionary/content_file.md +0 -22
  111. package/docs/zh/dictionary/function_fetching.md +23 -0
  112. package/docs/zh/eslint.md +9 -9
  113. package/docs/zh-TW/bundle_optimization.md +1 -1
  114. package/docs/zh-TW/eslint.md +9 -9
  115. package/package.json +5 -5
package/docs/vi/eslint.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-08-12
3
- updatedAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
4
  title: Plugin ESLint | Quy tắc Lint cho Intlayer
5
5
  description: Phát hiện chuỗi văn bản bị hardcode, các lệnh gọi động mà trình biên dịch Intlayer không thể tối ưu hóa và nội dung từ điển không sử dụng với eslint-plugin-intlayer. Hoạt động với ESLint và oxlint trên React, Vue, Svelte, Angular và Astro.
6
6
  keywords:
@@ -52,7 +52,7 @@ pnpm add --save-dev eslint-plugin-intlayer
52
52
  yarn add --dev eslint-plugin-intlayer
53
53
  ```
54
54
 
55
- Yêu cầu ESLint 9 trở lên (flat config).
55
+ Yêu cầu ESLint 9 trở lên (flat config). ESLint 10 được hỗ trợ.
56
56
 
57
57
  ## Cách sử dụng
58
58
 
@@ -61,20 +61,20 @@ Plugin hoạt động trên cả ESLint và [oxlint](https://oxc.rs) — cùng q
61
61
  <Tabs defaultTab="eslint">
62
62
  <Tab label="ESLint" value="eslint">
63
63
 
64
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
64
+ ```javascript fileName="eslint.config.mjs"
65
65
  import intlayer from "eslint-plugin-intlayer";
66
66
 
67
67
  export default [...intlayer.configs.recommended];
68
68
  ```
69
69
 
70
- Hoặc bật từng quy tắc một:
70
+ Hoặc trải một cấu hình và tự đặt mức độ nghiêm trọng:
71
71
 
72
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
72
+ ```javascript fileName="eslint.config.mjs"
73
73
  import intlayer from "eslint-plugin-intlayer";
74
74
 
75
75
  export default [
76
+ ...intlayer.configs.recommended,
76
77
  {
77
- plugins: { intlayer },
78
78
  rules: {
79
79
  "intlayer/no-raw-text": "warn",
80
80
  "intlayer/static-dictionary-key": "error",
@@ -144,7 +144,7 @@ Các tệp khai báo nội dung (`*.content.ts`, …) được bỏ qua.
144
144
 
145
145
  **Tùy chọn**
146
146
 
147
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
147
+ ```javascript fileName="eslint.config.mjs"
148
148
  {
149
149
  "intlayer/no-raw-text": [
150
150
  "warn",
@@ -247,7 +247,7 @@ Không giống như các quy tắc khác, quy tắc này không thể quyết đ
247
247
 
248
248
  **Tùy chọn**
249
249
 
250
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
250
+ ```javascript fileName="eslint.config.mjs"
251
251
  {
252
252
  "intlayer/no-unused-content": [
253
253
  "warn",
@@ -296,7 +296,7 @@ Mọi quy tắc đều hoạt động trên tất cả các tích hợp của In
296
296
  | Template Angular | `.component.html` | `@angular-eslint/template-parser` |
297
297
  | Astro | `.astro` | `astro-eslint-parser` |
298
298
 
299
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
299
+ ```javascript fileName="eslint.config.mjs"
300
300
  import intlayer from "eslint-plugin-intlayer";
301
301
  import tseslint from "typescript-eslint";
302
302
  import vueParser from "vue-eslint-parser";
@@ -159,7 +159,7 @@ pnpm add -D webpack-bundle-analyzer
159
159
  bun add -d webpack-bundle-analyzer
160
160
  ```
161
161
 
162
- ```typescript fileName="webpack.config.ts
162
+ ```typescript fileName="webpack.config.ts"
163
163
  import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
164
164
 
165
165
  export default {
@@ -477,6 +477,24 @@ const config: IntlayerConfig = {
477
477
  */
478
478
  purge: true,
479
479
 
480
+ /**
481
+ * 按使用它们的代码分割边界对各语言的字典分块进行分组,使懒加载页面只需一次请求即可获取其内容。
482
+ * 默认值:true
483
+ *
484
+ * 注意:
485
+ * - 仅适用于使用 `importMode: 'dynamic'` 的字典。
486
+ */
487
+ chunkGrouping: true,
488
+
489
+ /**
490
+ * 让字典与使用它的分块一起加载,而不是等该分块渲染后再获取。读取将同步渲染而不是挂起,因此导航时不再闪烁加载状态。
491
+ * 默认值:true
492
+ *
493
+ * 注意:
494
+ * - 仅等待已解析的语言,因此页面只会下载它所呈现的语言。
495
+ */
496
+ dictionariesPreload: true,
497
+
480
498
  /**
481
499
  * 生成的字典文件的输出格式。
482
500
  * 默认值:['cjs', 'esm']
@@ -1056,15 +1074,17 @@ Intlayer 支持多个 AI 提供商,以提供最大的灵活性。当前支持
1056
1074
 
1057
1075
  > 在优化期间,Intlayer 将替换字典调用以优化分块 (chunking),使生成的包仅导入实际使用的字典。
1058
1076
 
1059
- | 字段 | 说明 | 类型 | 默认值 | 示例 | 备注 |
1060
- | ----------------- | ---------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1061
- | `mode` | 控制构建模式。 | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: 构建在应用程序构建期间自动启动。<br/>• `'manual'`: 仅通过显式构建命令触发。<br/>• 可用于防止字典构建(例如避免在 Node.js 环境中运行)。 |
1062
- | `optimize` | 控制是否应执行构建优化。 | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • 如果未定义,则在框架构建 (Vite/Next.js) 期间启动优化。<br/>• `true` 在开发模式下也会强制执行优化。<br/>• `false` 将其禁用。<br/>• 如果启用,则会替换字典调用以优化分块。<br/>• 需要 `@intlayer/babel` 和 `@intlayer/swc` 插件。 |
1063
- | `minify` | 压缩字典以减小包体大小。 | `boolean` | `false` | | • 指定是否应最小化包内容。<br/>• 默认值:生产环境中为 `true`。<br/>• 如果禁用了 `optimize`,该选项将被忽略。<br/>• 如果 `editor.enabled` 为 true,该选项将被忽略。 |
1064
- | `purge` | 清除字典中未使用的键。 | `boolean` | `false` | | • 指定是否应清理包内容。<br/>• 默认值:生产环境中为 `true`。<br/>• 如果禁用了 `optimize`,该选项将被忽略。 |
1065
- | `checkTypes` | 指示构建是否应检查 TypeScript 类型并记录错误。 | `boolean` | `false` | | 可能会减慢构建过程。 |
1066
- | `outputFormat` | 控制字典的输出格式。 | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1067
- | `traversePattern` | 优化期间指定要扫描的文件的模式。 | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | • 通过将优化限制在相关文件来提高构建性能。<br/>• 如果 `optimize` 关闭则忽略。<br/>• 使用 glob 模式。 |
1077
+ | 字段 | 说明 | 类型 | 默认值 | 示例 | 备注 |
1078
+ | --------------------- | -------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1079
+ | `mode` | 控制构建模式。 | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: 构建在应用程序构建期间自动启动。<br/>• `'manual'`: 仅通过显式构建命令触发。<br/>• 可用于防止字典构建(例如避免在 Node.js 环境中运行)。 |
1080
+ | `optimize` | 控制是否应执行构建优化。 | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • 如果未定义,则在框架构建 (Vite/Next.js) 期间启动优化。<br/>• `true` 在开发模式下也会强制执行优化。<br/>• `false` 将其禁用。<br/>• 如果启用,则会替换字典调用以优化分块。<br/>• 需要 `@intlayer/babel` 和 `@intlayer/swc` 插件。 |
1081
+ | `minify` | 压缩字典以减小包体大小。 | `boolean` | `false` | | • 指定是否应最小化包内容。<br/>• 默认值:生产环境中为 `true`。<br/>• 如果禁用了 `optimize`,该选项将被忽略。<br/>• 如果 `editor.enabled` 为 true,该选项将被忽略。 |
1082
+ | `purge` | 清除字典中未使用的键。 | `boolean` | `false` | | • 指定是否应清理包内容。<br/>• 默认值:生产环境中为 `true`。<br/>• 如果禁用了 `optimize`,该选项将被忽略。 |
1083
+ | `checkTypes` | 指示构建是否应检查 TypeScript 类型并记录错误。 | `boolean` | `false` | | 可能会减慢构建过程。 |
1084
+ | `chunkGrouping` | 是否按使用它们的代码分割边界对各语言的字典分块进行分组。 | `boolean` | `true` | | • 不分组时,由众多组件构成的页面会为每个字典发出一次请求。<br/>• 从多个边界访问的字典会移入共享分块,因此任何页面都不会携带其他页面的内容。<br/>• 仅适用于使用 `importMode: 'dynamic'` 的字典。<br/>• 仅适用于客户端构建,且仅在打包时生效(开发模式除外)。 |
1085
+ | `dictionariesPreload` | 字典是否应与使用它的分块一起加载,而不是等该分块渲染后再获取。 | `boolean` | `true` | | 生成的入口点在顶层等待浏览语言,因此懒加载路由在其内容就绪前不会被视为已加载。<br/>• 读取将同步渲染而不是挂起,因此导航时不再闪烁加载状态。<br/>• 仅等待已解析的语言,因此页面只会下载它所呈现的语言。<br/>• 仅适用于客户端构建中使用 `importMode: 'dynamic'` 的字典。<br/>• 需要支持顶层 await 的打包工具(Vite、esbuild)。 |
1086
+ | `outputFormat` | 控制字典的输出格式。 | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1087
+ | `traversePattern` | 优化期间指定要扫描的文件的模式。 | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | • 通过将优化限制在相关文件来提高构建性能。<br/>• 如果 `optimize` 关闭则忽略。<br/>• 使用 glob 模式。 |
1068
1088
 
1069
1089
  ---
1070
1090
 
@@ -533,28 +533,6 @@ export default aboutPageMetaContent;
533
533
 
534
534
  > 参见 [变体](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dynamic_dictionaries/variants.md) 了解更多信息。
535
535
 
536
- #### `meta` (`Record<string, string | number | boolean>`)
537
-
538
- 与动态记录 (Dynamic Records) 配合使用,此字段允许通过不透明的 ID 声明 CMS 管理的的记录或在运行时获取的任意数据。字典身份由该 `meta` 字段中声明的任意键值对集定义。
539
-
540
- **示例:**
541
-
542
- ```typescript
543
- {
544
- key: "product-copy",
545
- meta: {
546
- id: "prod_abc",
547
- userId: "user_123"
548
- },
549
- content: {
550
- name: "Widget Pro",
551
- description: "The best widget."
552
- }
553
- }
554
- ```
555
-
556
- > 参见 [动态记录](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dynamic_dictionaries/dynamic_content.md) 了解更多信息。
557
-
558
536
  ### CMS 属性
559
537
 
560
538
  ##### `version`(字符串)
@@ -87,6 +87,29 @@ export default asyncFunctionContent;
87
87
 
88
88
  在这种情况下,`fakeFetch` 函数模拟了一个延迟以模拟服务器响应时间。Intlayer 会执行异步函数,并将结果用作 `text` 键的内容。
89
89
 
90
+ ## 获取远程内容
91
+
92
+ 你也可以直接将一个 Promise 赋值给内容字段。Intlayer 会在构建字典时等待它,并将解析后的值内联进字典:
93
+
94
+ ```typescript fileName="**/*.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
95
+ import type { Dictionary } from "intlayer";
96
+
97
+ const remoteContent = {
98
+ key: "remote_content",
99
+ content: {
100
+ externalContent: fetch("https://example.com").then((res) => res.json()),
101
+ },
102
+ } satisfies Dictionary;
103
+
104
+ export default remoteContent;
105
+ ```
106
+
107
+ ```plaintext fileName="**/*.content.json" contentDeclarationFormat="json"
108
+ 无法从JSON文件获取内容,请改用.ts或.js文件
109
+ ```
110
+
111
+ > 该请求在构建时执行,因此获取到的数据是嵌入字典中的快照。重新构建字典即可更新它。
112
+
90
113
  ## 在 React 组件中使用基于函数的内容
91
114
 
92
115
  要在 React 组件中使用基于函数的内容,您需要从 `react-intlayer` 导入 `useIntlayer` 并使用内容 ID 调用它以获取内容。示例如下:
package/docs/zh/eslint.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-08-12
3
- updatedAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
4
  title: ESLint 插件 | Intlayer 的 Lint 规则
5
5
  description: 使用 eslint-plugin-intlayer 捕获硬编码字符串、Intlayer 编译器无法优化的动态调用以及未使用的字典内容。支持 ESLint 和 oxlint,适用于 React、Vue、Svelte、Angular 和 Astro。
6
6
  keywords:
@@ -52,7 +52,7 @@ pnpm add --save-dev eslint-plugin-intlayer
52
52
  yarn add --dev eslint-plugin-intlayer
53
53
  ```
54
54
 
55
- 需要 ESLint 9 或更高版本(Flat config)。
55
+ 需要 ESLint 9 或更高版本(Flat config)。支持 ESLint 10。
56
56
 
57
57
  ## 使用方法
58
58
 
@@ -61,20 +61,20 @@ yarn add --dev eslint-plugin-intlayer
61
61
  <Tabs defaultTab="eslint">
62
62
  <Tab label="ESLint" value="eslint">
63
63
 
64
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
64
+ ```javascript fileName="eslint.config.mjs"
65
65
  import intlayer from "eslint-plugin-intlayer";
66
66
 
67
67
  export default [...intlayer.configs.recommended];
68
68
  ```
69
69
 
70
- 或者逐个启用规则:
70
+ 或者展开某个配置并自行设置严重级别:
71
71
 
72
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
72
+ ```javascript fileName="eslint.config.mjs"
73
73
  import intlayer from "eslint-plugin-intlayer";
74
74
 
75
75
  export default [
76
+ ...intlayer.configs.recommended,
76
77
  {
77
- plugins: { intlayer },
78
78
  rules: {
79
79
  "intlayer/no-raw-text": "warn",
80
80
  "intlayer/static-dictionary-key": "error",
@@ -144,7 +144,7 @@ const { title } = useIntlayer("home");
144
144
 
145
145
  **配置选项**
146
146
 
147
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
147
+ ```javascript fileName="eslint.config.mjs"
148
148
  {
149
149
  "intlayer/no-raw-text": [
150
150
  "warn",
@@ -247,7 +247,7 @@ export default {
247
247
 
248
248
  **配置选项**
249
249
 
250
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
250
+ ```javascript fileName="eslint.config.mjs"
251
251
  {
252
252
  "intlayer/no-unused-content": [
253
253
  "warn",
@@ -296,7 +296,7 @@ export default {
296
296
  | Angular 模板 | `.component.html` | `@angular-eslint/template-parser` |
297
297
  | Astro | `.astro` | `astro-eslint-parser` |
298
298
 
299
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
299
+ ```javascript fileName="eslint.config.mjs"
300
300
  import intlayer from "eslint-plugin-intlayer";
301
301
  import tseslint from "typescript-eslint";
302
302
  import vueParser from "vue-eslint-parser";
@@ -159,7 +159,7 @@ pnpm add -D webpack-bundle-analyzer
159
159
  bun add -d webpack-bundle-analyzer
160
160
  ```
161
161
 
162
- ```typescript fileName="webpack.config.ts
162
+ ```typescript fileName="webpack.config.ts"
163
163
  import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
164
164
 
165
165
  export default {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-08-12
3
- updatedAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
4
  title: ESLint 外掛 | Intlayer 的 Lint 規則
5
5
  description: 使用 eslint-plugin-intlayer 捕捉硬編碼字串、Intlayer 編譯器無法最佳化的動態呼叫以及未使用的字典內容。支援 ESLint 與 oxlint,適用於 React、Vue、Svelte、Angular 與 Astro。
6
6
  keywords:
@@ -52,7 +52,7 @@ pnpm add --save-dev eslint-plugin-intlayer
52
52
  yarn add --dev eslint-plugin-intlayer
53
53
  ```
54
54
 
55
- 需要 ESLint 9 或更高版本(Flat config)。
55
+ 需要 ESLint 9 或更高版本(Flat config)。支援 ESLint 10。
56
56
 
57
57
  ## 使用方法
58
58
 
@@ -61,20 +61,20 @@ yarn add --dev eslint-plugin-intlayer
61
61
  <Tabs defaultTab="eslint">
62
62
  <Tab label="ESLint" value="eslint">
63
63
 
64
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
64
+ ```javascript fileName="eslint.config.mjs"
65
65
  import intlayer from "eslint-plugin-intlayer";
66
66
 
67
67
  export default [...intlayer.configs.recommended];
68
68
  ```
69
69
 
70
- 或者逐一啟用規則:
70
+ 或者展開某個設定並自行指定嚴重程度:
71
71
 
72
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
72
+ ```javascript fileName="eslint.config.mjs"
73
73
  import intlayer from "eslint-plugin-intlayer";
74
74
 
75
75
  export default [
76
+ ...intlayer.configs.recommended,
76
77
  {
77
- plugins: { intlayer },
78
78
  rules: {
79
79
  "intlayer/no-raw-text": "warn",
80
80
  "intlayer/static-dictionary-key": "error",
@@ -144,7 +144,7 @@ const { title } = useIntlayer("home");
144
144
 
145
145
  **設定選項**
146
146
 
147
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
147
+ ```javascript fileName="eslint.config.mjs"
148
148
  {
149
149
  "intlayer/no-raw-text": [
150
150
  "warn",
@@ -247,7 +247,7 @@ export default {
247
247
 
248
248
  **設定選項**
249
249
 
250
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
250
+ ```javascript fileName="eslint.config.mjs"
251
251
  {
252
252
  "intlayer/no-unused-content": [
253
253
  "warn",
@@ -296,7 +296,7 @@ export default {
296
296
  | Angular 範本 | `.component.html` | `@angular-eslint/template-parser` |
297
297
  | Astro | `.astro` | `astro-eslint-parser` |
298
298
 
299
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
299
+ ```javascript fileName="eslint.config.mjs"
300
300
  import intlayer from "eslint-plugin-intlayer";
301
301
  import tseslint from "typescript-eslint";
302
302
  import vueParser from "vue-eslint-parser";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/docs",
3
- "version": "9.3.2",
3
+ "version": "9.3.3",
4
4
  "private": false,
5
5
  "description": "Intlayer documentation",
6
6
  "keywords": [
@@ -73,9 +73,9 @@
73
73
  "watch": "webpack --config ./webpack.config.ts --watch"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/config": "9.3.2",
77
- "@intlayer/core": "9.3.2",
78
- "@intlayer/types": "9.3.2"
76
+ "@intlayer/config": "9.3.3",
77
+ "@intlayer/core": "9.3.3",
78
+ "@intlayer/types": "9.3.3"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@intlayer/api": "9.3.2",
@@ -88,7 +88,7 @@
88
88
  "rimraf": "6.1.3",
89
89
  "tsdown": "0.22.14",
90
90
  "typescript": "7.0.2",
91
- "vitest": "4.1.10"
91
+ "vitest": "4.1.11"
92
92
  },
93
93
  "engines": {
94
94
  "node": ">=14.18"