@pawover/eslint-rules 0.0.2 → 0.2.0

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.
@@ -1,13 +1,69 @@
1
+ import preset from "./preset.js";
1
2
  export default {
3
+ /**
4
+ * @desc 强制链式成员访问的换行风格保持一致
5
+ * @descEN Enforce consistent line breaks for chaining member access
6
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-chaining.md
7
+ */
2
8
  "antfu/consistent-chaining": 2,
9
+ /**
10
+ * @desc 强制括号和圆括号内部的换行风格保持一致
11
+ * @descEN Enforce consistent line breaks inside braces and parentheses
12
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md
13
+ */
3
14
  "antfu/consistent-list-newline": 2,
4
- "antfu/curly": 2,
15
+ /**
16
+ * @desc 个人偏好的花括号规则,允许单行同时使用两种风格
17
+ * @descEN Opinionated curly bracket enforcement that allows both styles on one-liners
18
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/curly.md
19
+ */
20
+ "antfu/curly": 0,
21
+ /**
22
+ * @desc 强制 if 语句与其后续表达式之间换行
23
+ * @descEN Enforce a newline between `if` and its consequent
24
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md
25
+ */
5
26
  "antfu/if-newline": 2,
27
+ /**
28
+ * @desc 自动去重来自同一来源的具名导入
29
+ * @descEN Auto-fix duplicate named imports from the same source
30
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/import-dedupe.md
31
+ */
6
32
  "antfu/import-dedupe": 2,
7
- "antfu/indent-unindent": 2,
33
+ /**
34
+ * @desc 强制 `unindent` 模板字符串标签内的缩进风格保持一致
35
+ * @descEN Enforce consistent indentation inside `unindent` tagged template strings
36
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/indent-unindent.md
37
+ */
38
+ "antfu/indent-unindent": [2, { indent: preset.indent, tags: ["$", "unindent", "unIndent"] }],
39
+ /**
40
+ * @desc 禁止从本地 dist 文件夹导入
41
+ * @descEN Prevent importing from a local `dist` folder
42
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-dist.md
43
+ */
8
44
  "antfu/no-import-dist": 2,
45
+ /**
46
+ * @desc 禁止通过相对或绝对路径从 node_modules 导入
47
+ * @descEN Prevent importing from `node_modules` by relative or absolute path
48
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.md
49
+ */
9
50
  "antfu/no-import-node-modules-by-path": 2,
10
- "antfu/no-top-level-await": 2,
51
+ /**
52
+ * @desc 禁止顶层 await
53
+ * @descEN Prevent top-level `await`
54
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.md
55
+ */
56
+ "antfu/no-top-level-await": 0,
57
+ /**
58
+ * @desc 禁止使用 TypeScript 的 export = 语法
59
+ * @descEN Disallow TypeScript's `export =` syntax
60
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.md
61
+ */
11
62
  "antfu/no-ts-export-equal": 2,
63
+ /**
64
+ * @desc 强制顶层函数使用 function 关键字声明
65
+ * @descEN Enforce top-level functions to be declared with the `function` keyword
66
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/top-level-function.md
67
+ */
12
68
  "antfu/top-level-function": 2,
13
69
  };
@@ -1,11 +1,56 @@
1
1
  export default {
2
+ /**
3
+ * @desc 强制类型导入的标记风格保持一致(顶级或内联)
4
+ * @descEN Enforce consistent style for type-only import specifiers (top-level vs inline)
5
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
6
+ */
2
7
  "imports/consistent-type-specifier-style": [2, "prefer-top-level"],
8
+ /**
9
+ * @desc 确保所有导出语句都在文件末尾
10
+ * @descEN Ensure all exports are declared at the bottom of the file
11
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/exports-last/README.md
12
+ */
3
13
  "imports/exports-last": 0,
14
+ /**
15
+ * @desc 确保所有 import 语句在文件顶部
16
+ * @descEN Ensure all imports are at the top of the file
17
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
18
+ */
4
19
  "imports/first": 2,
20
+ /**
21
+ * @desc 强制在最后一个 import 或 require 语句后留有空行
22
+ * @descEN Enforce one or more empty lines after the last top-level import or require
23
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/newline-after-import/README.md
24
+ */
5
25
  "imports/newline-after-import": [2, { count: 1 }],
26
+ /**
27
+ * @desc 禁止使用默认导出
28
+ * @descEN Disallow default exports
29
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-default-export/README.md
30
+ */
6
31
  "imports/no-default-export": 0,
32
+ /**
33
+ * @desc 禁止重复导入同一模块
34
+ * @descEN Disallow duplicate imports from the same module
35
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-duplicates/README.md
36
+ */
7
37
  "imports/no-duplicates": 2,
38
+ /**
39
+ * @desc 禁止使用 var 或 let 导出可变绑定
40
+ * @descEN Forbid mutable exports using `var` or `let`
41
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-mutable-exports/README.md
42
+ */
8
43
  "imports/no-mutable-exports": 2,
44
+ /**
45
+ * @desc 禁止将默认导入作为具名导入使用
46
+ * @descEN Disallow named import of default exports
47
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-named-default/README.md
48
+ */
9
49
  "imports/no-named-default": 2,
50
+ /**
51
+ * @desc 优先使用默认导出而非具名导出
52
+ * @descEN Prefer default export over named export
53
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/prefer-default-export/README.md
54
+ */
10
55
  "imports/prefer-default-export": 0,
11
56
  };