@kikiutils/eslint-config 11.2.1 → 11.4.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.
Files changed (94) hide show
  1. package/dist/_internals/configs/base-rules.d.ts +3 -0
  2. package/dist/_internals/configs/base-rules.d.ts.map +1 -0
  3. package/dist/_internals/configs/base-rules.js +190 -0
  4. package/dist/_internals/configs/base-rules.js.map +1 -0
  5. package/dist/_internals/configs/jsdoc.d.ts.map +1 -0
  6. package/dist/_internals/{jsdoc.js → configs/jsdoc.js} +1 -1
  7. package/dist/_internals/configs/jsdoc.js.map +1 -0
  8. package/dist/_internals/configs/restricted-syntax.d.ts.map +1 -0
  9. package/dist/_internals/configs/restricted-syntax.js +12 -0
  10. package/dist/_internals/configs/restricted-syntax.js.map +1 -0
  11. package/dist/_internals/configs/type-aware.d.ts.map +1 -0
  12. package/dist/_internals/configs/type-aware.js +48 -0
  13. package/dist/_internals/configs/type-aware.js.map +1 -0
  14. package/dist/_internals/configs/typefest.d.ts.map +1 -0
  15. package/dist/_internals/{typefest.js → configs/typefest.js} +1 -1
  16. package/dist/_internals/configs/typefest.js.map +1 -0
  17. package/dist/_internals/rules/comment-indent.d.ts +3 -0
  18. package/dist/_internals/rules/comment-indent.d.ts.map +1 -0
  19. package/dist/_internals/rules/comment-indent.js +58 -0
  20. package/dist/_internals/rules/comment-indent.js.map +1 -0
  21. package/dist/_internals/rules/index.d.ts +19 -0
  22. package/dist/_internals/rules/index.d.ts.map +1 -0
  23. package/dist/_internals/rules/index.js +34 -0
  24. package/dist/_internals/rules/index.js.map +1 -0
  25. package/dist/_internals/rules/nitro-route-method-suffix.d.ts +3 -0
  26. package/dist/_internals/rules/nitro-route-method-suffix.d.ts.map +1 -0
  27. package/dist/_internals/rules/nitro-route-method-suffix.js +25 -0
  28. package/dist/_internals/rules/nitro-route-method-suffix.js.map +1 -0
  29. package/dist/_internals/rules/no-composable-in-head-getter.d.ts +3 -0
  30. package/dist/_internals/rules/no-composable-in-head-getter.d.ts.map +1 -0
  31. package/dist/_internals/rules/no-composable-in-head-getter.js +41 -0
  32. package/dist/_internals/rules/no-composable-in-head-getter.js.map +1 -0
  33. package/dist/_internals/rules/no-silent-catch.d.ts +3 -0
  34. package/dist/_internals/rules/no-silent-catch.d.ts.map +1 -0
  35. package/dist/_internals/rules/no-silent-catch.js +38 -0
  36. package/dist/_internals/rules/no-silent-catch.js.map +1 -0
  37. package/dist/_internals/rules/no-thenable-zod-refinement.d.ts +3 -0
  38. package/dist/_internals/rules/no-thenable-zod-refinement.d.ts.map +1 -0
  39. package/dist/_internals/rules/no-thenable-zod-refinement.js +41 -0
  40. package/dist/_internals/rules/no-thenable-zod-refinement.js.map +1 -0
  41. package/dist/_internals/rules/promise-function-async.d.ts +3 -0
  42. package/dist/_internals/rules/promise-function-async.d.ts.map +1 -0
  43. package/dist/_internals/rules/promise-function-async.js +32 -0
  44. package/dist/_internals/rules/promise-function-async.js.map +1 -0
  45. package/dist/_internals/rules/statement-padding.js +2 -1
  46. package/dist/_internals/rules/statement-padding.js.map +1 -1
  47. package/dist/base.d.ts +3 -2
  48. package/dist/base.d.ts.map +1 -1
  49. package/dist/base.js +6 -183
  50. package/dist/base.js.map +1 -1
  51. package/dist/nuxt.d.ts +3 -0
  52. package/dist/nuxt.d.ts.map +1 -0
  53. package/dist/nuxt.js +94 -0
  54. package/dist/nuxt.js.map +1 -0
  55. package/dist/vue.d.ts.map +1 -1
  56. package/dist/vue.js +11 -14
  57. package/dist/vue.js.map +1 -1
  58. package/package.json +8 -6
  59. package/src/_internals/configs/base-rules.ts +335 -0
  60. package/src/_internals/{restricted-syntax.ts → configs/restricted-syntax.ts} +0 -4
  61. package/src/_internals/configs/type-aware.ts +70 -0
  62. package/src/_internals/rules/comment-indent.ts +87 -0
  63. package/src/_internals/rules/index.ts +38 -0
  64. package/src/_internals/rules/nitro-route-method-suffix.ts +27 -0
  65. package/src/_internals/rules/no-composable-in-head-getter.ts +52 -0
  66. package/src/_internals/rules/no-silent-catch.ts +58 -0
  67. package/src/_internals/rules/no-thenable-zod-refinement.ts +70 -0
  68. package/src/_internals/rules/promise-function-async.ts +56 -0
  69. package/src/_internals/rules/statement-padding.ts +1 -0
  70. package/src/base.ts +9 -334
  71. package/src/nuxt.ts +131 -0
  72. package/src/vue.ts +11 -14
  73. package/dist/_internals/jsdoc.d.ts.map +0 -1
  74. package/dist/_internals/jsdoc.js.map +0 -1
  75. package/dist/_internals/plugins.d.ts +0 -9
  76. package/dist/_internals/plugins.d.ts.map +0 -1
  77. package/dist/_internals/plugins.js +0 -14
  78. package/dist/_internals/plugins.js.map +0 -1
  79. package/dist/_internals/restricted-syntax.d.ts.map +0 -1
  80. package/dist/_internals/restricted-syntax.js +0 -16
  81. package/dist/_internals/restricted-syntax.js.map +0 -1
  82. package/dist/_internals/type-aware.d.ts.map +0 -1
  83. package/dist/_internals/type-aware.js +0 -29
  84. package/dist/_internals/type-aware.js.map +0 -1
  85. package/dist/_internals/typefest.d.ts.map +0 -1
  86. package/dist/_internals/typefest.js.map +0 -1
  87. package/src/_internals/plugins.ts +0 -13
  88. package/src/_internals/type-aware.ts +0 -42
  89. /package/dist/_internals/{jsdoc.d.ts → configs/jsdoc.d.ts} +0 -0
  90. /package/dist/_internals/{restricted-syntax.d.ts → configs/restricted-syntax.d.ts} +0 -0
  91. /package/dist/_internals/{type-aware.d.ts → configs/type-aware.d.ts} +0 -0
  92. /package/dist/_internals/{typefest.d.ts → configs/typefest.d.ts} +0 -0
  93. /package/src/_internals/{jsdoc.ts → configs/jsdoc.ts} +0 -0
  94. /package/src/_internals/{typefest.ts → configs/typefest.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ import { Rules } from "@antfu/eslint-config";
2
+ export declare function createBaseRules(environment?: 'bun' | 'node'): Rules;
3
+ //# sourceMappingURL=base-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-rules.d.ts","names":[],"sources":["../../../src/_internals/configs/base-rules.ts"],"mappings":";wBASgB,gBAAgB,+BAAuC"}
@@ -0,0 +1,190 @@
1
+ import { restrictedSyntax } from "./restricted-syntax.js";
2
+ // src/_internals/configs/base-rules.ts
3
+ const basePerfectionistSortOptions = {
4
+ ignoreCase: false,
5
+ type: "natural"
6
+ };
7
+ function createBaseRules(environment = "node") {
8
+ return {
9
+ "antfu/consistent-list-newline": ["error", {
10
+ ArrayExpression: false,
11
+ ArrayPattern: false
12
+ }],
13
+ "antfu/curly": "off",
14
+ "antfu/if-newline": "off",
15
+ "antfu/no-top-level-await": "off",
16
+ "antfu/reasonable-newline": "off",
17
+ "arrow-body-style": ["error", "as-needed"],
18
+ "curly": ["error", "multi-line"],
19
+ "jsdoc/check-tag-names": "error",
20
+ "jsdoc/multiline-blocks": ["error", {
21
+ noSingleLineBlocks: true,
22
+ singleLineTags: ["type", "import"]
23
+ }],
24
+ "jsdoc/no-blank-blocks": ["error", { enableFixer: true }],
25
+ "jsdoc/require-asterisk-prefix": "error",
26
+ "jsdoc/require-hyphen-before-param-description": [
27
+ "error",
28
+ "always",
29
+ { tags: { typeParam: "always" } }
30
+ ],
31
+ "kikiutils/comment-indent": "error",
32
+ "kikiutils/compact-iteration-layout": "error",
33
+ "kikiutils/consistent-condition-layout": "error",
34
+ "kikiutils/consistent-parameter-layout": "error",
35
+ "kikiutils/no-silent-catch": "error",
36
+ "kikiutils/statement-padding": "error",
37
+ "max-classes-per-file": ["error", 1],
38
+ "no-constant-binary-expression": "error",
39
+ "no-empty": ["error", { allowEmptyCatch: false }],
40
+ "no-promise-executor-return": ["error", { allowVoid: true }],
41
+ "no-restricted-imports": ["error", { patterns: [{
42
+ message: "`_internals` modules are private to their own directory; import the public module instead.",
43
+ regex: String.raw`^[^.].*/_internals(/|$)`
44
+ }] }],
45
+ "no-restricted-syntax": ["error", ...restrictedSyntax],
46
+ "no-useless-assignment": "error",
47
+ "perfectionist/sort-array-includes": ["error", basePerfectionistSortOptions],
48
+ "perfectionist/sort-enums": ["error", {
49
+ ...basePerfectionistSortOptions,
50
+ sortByValue: "never"
51
+ }],
52
+ "perfectionist/sort-heritage-clauses": ["error", basePerfectionistSortOptions],
53
+ "perfectionist/sort-imports": ["error", {
54
+ environment,
55
+ groups: [
56
+ "side-effect",
57
+ "side-effect-style",
58
+ "style",
59
+ ["value-builtin", "type-builtin"],
60
+ ["value-external", "type-external"],
61
+ ["value-internal", "type-internal"],
62
+ ["value-parent", "type-parent"],
63
+ ["value-sibling", "type-sibling"],
64
+ ["value-index", "type-index"],
65
+ "unknown"
66
+ ],
67
+ ignoreCase: false,
68
+ internalPattern: [
69
+ "^#.*",
70
+ "^@/.*",
71
+ "^~/.*"
72
+ ],
73
+ type: "natural"
74
+ }],
75
+ "perfectionist/sort-interfaces": ["error", basePerfectionistSortOptions],
76
+ "perfectionist/sort-intersection-types": ["error", basePerfectionistSortOptions],
77
+ "perfectionist/sort-maps": ["error", basePerfectionistSortOptions],
78
+ "perfectionist/sort-modules": ["error", {
79
+ ...basePerfectionistSortOptions,
80
+ groups: [
81
+ "declare-type",
82
+ ["export-type", "type"],
83
+ "declare-interface",
84
+ ["export-interface", "interface"],
85
+ "declare-enum",
86
+ ["enum", "export-enum"],
87
+ "declare-class",
88
+ ["class", "export-class"],
89
+ "declare-function",
90
+ ["export-function", "function"]
91
+ ]
92
+ }],
93
+ "perfectionist/sort-object-types": ["error", basePerfectionistSortOptions],
94
+ "perfectionist/sort-objects": ["error", basePerfectionistSortOptions],
95
+ "perfectionist/sort-sets": ["error", basePerfectionistSortOptions],
96
+ "perfectionist/sort-switch-case": ["error", {
97
+ ignoreCase: false,
98
+ type: "natural"
99
+ }],
100
+ "perfectionist/sort-union-types": ["error", basePerfectionistSortOptions],
101
+ "perfectionist/sort-variable-declarations": ["error", basePerfectionistSortOptions],
102
+ "preserve-caught-error": "error",
103
+ "promise/no-multiple-resolved": "error",
104
+ "promise/no-return-in-finally": "error",
105
+ "promise/no-return-wrap": "error",
106
+ "require-await": "off",
107
+ "style/array-bracket-newline": ["error", { multiline: true }],
108
+ "style/array-element-newline": ["error", {
109
+ ArrayExpression: {
110
+ consistent: true,
111
+ minItems: 2
112
+ },
113
+ ArrayPattern: { minItems: 3 }
114
+ }],
115
+ "style/arrow-parens": ["error", "always"],
116
+ "style/brace-style": [
117
+ "error",
118
+ "1tbs",
119
+ { allowSingleLine: false }
120
+ ],
121
+ "style/function-call-spacing": ["error", "never"],
122
+ "style/indent": ["error", 4],
123
+ "style/max-len": ["warn", {
124
+ code: 120,
125
+ comments: 120,
126
+ ignoreStrings: true,
127
+ ignoreTemplateLiterals: true
128
+ }],
129
+ "style/member-delimiter-style": ["error", { multiline: {
130
+ delimiter: "semi",
131
+ requireLast: true
132
+ } }],
133
+ "style/no-extra-parens": [
134
+ "error",
135
+ "all",
136
+ { nestedBinaryExpressions: false }
137
+ ],
138
+ "style/no-extra-semi": "error",
139
+ "style/object-curly-newline": ["error", {
140
+ ExportDeclaration: {
141
+ minProperties: 2,
142
+ multiline: true
143
+ },
144
+ ImportDeclaration: {
145
+ minProperties: 2,
146
+ multiline: true
147
+ },
148
+ ObjectExpression: {
149
+ minProperties: 2,
150
+ multiline: true
151
+ },
152
+ ObjectPattern: {
153
+ minProperties: 3,
154
+ multiline: true
155
+ }
156
+ }],
157
+ "style/operator-linebreak": [
158
+ "error",
159
+ "before",
160
+ { overrides: { "=": "after" } }
161
+ ],
162
+ "style/padding-line-between-statements": [
163
+ "error",
164
+ {
165
+ blankLine: "always",
166
+ next: [
167
+ "class",
168
+ "enum",
169
+ "function"
170
+ ],
171
+ prev: "*"
172
+ },
173
+ {
174
+ blankLine: "always",
175
+ next: "*",
176
+ prev: ["class", "function"]
177
+ }
178
+ ],
179
+ "style/semi": ["error", "always"],
180
+ "unicorn/no-useless-promise-resolve-reject": "error",
181
+ "unicorn/no-useless-spread": "error",
182
+ "unicorn/prefer-array-find": "error",
183
+ "unicorn/prefer-array-some": "error",
184
+ "unicorn/prefer-at": "error",
185
+ "unicorn/prefer-string-replace-all": "error"
186
+ };
187
+ }
188
+ export { createBaseRules };
189
+
190
+ //# sourceMappingURL=base-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-rules.js","names":[],"sources":["../../../src/_internals/configs/base-rules.ts"],"sourcesContent":["import type { Rules } from '@antfu/eslint-config';\n\nimport { restrictedSyntax } from './restricted-syntax';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'antfu/reasonable-newline': 'off',\n 'arrow-body-style': [\n 'error',\n 'as-needed',\n ],\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'jsdoc/check-tag-names': 'error',\n 'jsdoc/multiline-blocks': [\n 'error',\n {\n noSingleLineBlocks: true,\n singleLineTags: [\n 'type',\n 'import',\n ],\n },\n ],\n 'jsdoc/no-blank-blocks': [\n 'error',\n { enableFixer: true },\n ],\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-hyphen-before-param-description': [\n 'error',\n 'always',\n { tags: { typeParam: 'always' } },\n ],\n 'kikiutils/comment-indent': 'error',\n 'kikiutils/compact-iteration-layout': 'error',\n 'kikiutils/consistent-condition-layout': 'error',\n 'kikiutils/consistent-parameter-layout': 'error',\n 'kikiutils/no-silent-catch': 'error',\n 'kikiutils/statement-padding': 'error',\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-constant-binary-expression': 'error',\n // An ignored error needs at least a comment in the block saying why.\n 'no-empty': [\n 'error',\n { allowEmptyCatch: false },\n ],\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'no-restricted-imports': [\n 'error',\n {\n patterns: [\n {\n message: '`_internals` modules are private to their own directory; import the public module instead.',\n regex: String.raw`^[^.].*/_internals(/|$)`,\n },\n ],\n },\n ],\n 'no-restricted-syntax': [\n 'error',\n ...restrictedSyntax,\n ],\n 'no-useless-assignment': 'error',\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'preserve-caught-error': 'error',\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'off',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n ignoreStrings: true,\n ignoreTemplateLiterals: true,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'unicorn/no-useless-promise-resolve-reject': 'error',\n 'unicorn/no-useless-spread': 'error',\n 'unicorn/prefer-array-find': 'error',\n 'unicorn/prefer-array-some': 'error',\n 'unicorn/prefer-at': 'error',\n 'unicorn/prefer-string-replace-all': 'error',\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsdoc.d.ts","names":[],"sources":["../../../src/_internals/configs/jsdoc.ts"],"mappings":"A,qBAEa;;;;;;;;;;;;;qBAcA"}
@@ -1,4 +1,4 @@
1
- // src/_internals/jsdoc.ts
1
+ // src/_internals/configs/jsdoc.ts
2
2
  const jsdocSettings = { jsdoc: { tagNamePreference: {
3
3
  arg: "param",
4
4
  argument: "param",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsdoc.js","names":[],"sources":["../../../src/_internals/configs/jsdoc.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport const jsdocSettings = {\n jsdoc: {\n tagNamePreference: {\n arg: 'param',\n argument: 'param',\n desc: false,\n description: false,\n exception: 'throws',\n return: 'returns',\n types: false,\n },\n },\n};\n\nexport const typescriptJsdocConfig = {\n rules: {\n 'jsdoc/check-tag-names': [\n 'error',\n {\n definedTags: [\n 'alpha',\n 'beta',\n 'defaultValue',\n 'eventProperty',\n 'experimental',\n 'hidden',\n 'inheritDoc',\n 'internal',\n 'packageDocumentation',\n 'privateRemarks',\n 'remarks',\n 'sealed',\n 'typeParam',\n 'virtual',\n ],\n },\n ],\n 'jsdoc/multiline-blocks': [\n 'error',\n {\n noSingleLineBlocks: true,\n singleLineTags: [],\n },\n ],\n 'jsdoc/no-types': 'error',\n },\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: {\n ...jsdocSettings.jsdoc.tagNamePreference,\n callback: false,\n class: false,\n constructor: false,\n default: 'defaultValue',\n function: false,\n method: false,\n readonly: false,\n static: false,\n template: false,\n type: false,\n typedef: false,\n typeParam: 'typeParam',\n virtual: 'virtual',\n },\n },\n },\n} satisfies TypedFlatConfigItem;\n"],"mappings":";AAEA,MAAa,gBAAgB,EACzB,OAAO,EACH,mBAAmB;CACf,KAAK;CACL,UAAU;CACV,MAAM;CACN,aAAa;CACb,WAAW;CACX,QAAQ;CACR,OAAO;AACX,EACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,OAAO;EACH,yBAAyB,CACrB,SACA,EACI,aAAa;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ,EACJ,CACJ;EACA,0BAA0B,CACtB,SACA;GACI,oBAAoB;GACpB,gBAAgB,CAAC;EACrB,CACJ;EACA,kBAAkB;CACtB;CACA,UAAU,EACN,OAAO;EACH,MAAM;EACN,mBAAmB;GACf,GAAG,cAAc,MAAM;GACvB,UAAU;GACV,OAAO;GACP,aAAa;GACb,SAAS;GACT,UAAU;GACV,QAAQ;GACR,UAAU;GACV,QAAQ;GACR,UAAU;GACV,MAAM;GACN,SAAS;GACT,WAAW;GACX,SAAS;EACb;CACJ,EACJ;AACJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restricted-syntax.d.ts","names":[],"sources":["../../../src/_internals/configs/restricted-syntax.ts"],"mappings":"A,qBAAa"}
@@ -0,0 +1,12 @@
1
+ // src/_internals/configs/restricted-syntax.ts
2
+ const restrictedSyntax = [
3
+ "TSEnumDeclaration[const=true]",
4
+ "TSExportAssignment",
5
+ {
6
+ message: "Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.",
7
+ selector: "BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]"
8
+ }
9
+ ];
10
+ export { restrictedSyntax };
11
+
12
+ //# sourceMappingURL=restricted-syntax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restricted-syntax.js","names":[],"sources":["../../../src/_internals/configs/restricted-syntax.ts"],"sourcesContent":["export const restrictedSyntax = [\n 'TSEnumDeclaration[const=true]',\n 'TSExportAssignment',\n {\n message: 'Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.',\n selector: 'BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]',\n },\n];\n"],"mappings":";AAAA,MAAa,mBAAmB;CAC5B;CACA;CACA;EACI,SAAS;EACT,UAAU;CACd;AACJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-aware.d.ts","names":[],"sources":["../../../src/_internals/configs/type-aware.ts"],"mappings":";wBAEgB,yBAAyB"}
@@ -0,0 +1,48 @@
1
+ // src/_internals/configs/type-aware.ts
2
+ function createTypeAwareConfig() {
3
+ return {
4
+ languageOptions: { parserOptions: {
5
+ projectService: true,
6
+ tsconfigRootDir: process.cwd()
7
+ } },
8
+ rules: {
9
+ "kikiutils/no-thenable-zod-refinement": "error",
10
+ "kikiutils/promise-function-async": "error",
11
+ "no-implied-eval": "off",
12
+ "no-throw-literal": "off",
13
+ "prefer-promise-reject-errors": "off",
14
+ "ts/await-thenable": "error",
15
+ "ts/consistent-type-exports": "error",
16
+ "ts/no-array-delete": "error",
17
+ "ts/no-base-to-string": "error",
18
+ "ts/no-deprecated": "error",
19
+ "ts/no-duplicate-type-constituents": "error",
20
+ "ts/no-floating-promises": ["error", { allowForKnownSafePromises: [{
21
+ from: "package",
22
+ name: "SafePromise",
23
+ package: "@kikiutils/shared"
24
+ }] }],
25
+ "ts/no-for-in-array": "error",
26
+ "ts/no-implied-eval": "error",
27
+ "ts/no-misused-promises": "error",
28
+ "ts/no-misused-spread": "error",
29
+ "ts/no-unnecessary-boolean-literal-compare": "error",
30
+ "ts/no-unnecessary-template-expression": "error",
31
+ "ts/no-unnecessary-type-arguments": "error",
32
+ "ts/no-unnecessary-type-assertion": "error",
33
+ "ts/only-throw-error": "error",
34
+ "ts/prefer-promise-reject-errors": ["error", {
35
+ allowThrowingAny: true,
36
+ allowThrowingUnknown: true
37
+ }],
38
+ "ts/promise-function-async": "off",
39
+ "ts/require-await": "off",
40
+ "ts/restrict-template-expressions": ["error", { allowNever: true }],
41
+ "ts/return-await": ["error", "always"],
42
+ "ts/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }]
43
+ }
44
+ };
45
+ }
46
+ export { createTypeAwareConfig };
47
+
48
+ //# sourceMappingURL=type-aware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-aware.js","names":[],"sources":["../../../src/_internals/configs/type-aware.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport function createTypeAwareConfig(): TypedFlatConfigItem {\n return {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n rules: {\n 'kikiutils/no-thenable-zod-refinement': 'error',\n 'kikiutils/promise-function-async': 'error',\n // The typed replacements below report these more accurately.\n 'no-implied-eval': 'off',\n 'no-throw-literal': 'off',\n 'prefer-promise-reject-errors': 'off',\n 'ts/await-thenable': 'error',\n 'ts/consistent-type-exports': 'error',\n 'ts/no-array-delete': 'error',\n 'ts/no-base-to-string': 'error',\n 'ts/no-deprecated': 'error',\n 'ts/no-duplicate-type-constituents': 'error',\n 'ts/no-floating-promises': [\n 'error',\n {\n allowForKnownSafePromises: [\n {\n from: 'package',\n name: 'SafePromise',\n package: '@kikiutils/shared',\n },\n ],\n },\n ],\n 'ts/no-for-in-array': 'error',\n 'ts/no-implied-eval': 'error',\n 'ts/no-misused-promises': 'error',\n 'ts/no-misused-spread': 'error',\n 'ts/no-unnecessary-boolean-literal-compare': 'error',\n 'ts/no-unnecessary-template-expression': 'error',\n 'ts/no-unnecessary-type-arguments': 'error',\n 'ts/no-unnecessary-type-assertion': 'error',\n 'ts/only-throw-error': 'error',\n // Matches only-throw-error, which allows `any` and `unknown` by default.\n 'ts/prefer-promise-reject-errors': [\n 'error',\n {\n allowThrowingAny: true,\n allowThrowingUnknown: true,\n },\n ],\n 'ts/promise-function-async': 'off',\n 'ts/require-await': 'off',\n // Exhaustive-switch fallbacks interpolate the `never` value into their error message.\n 'ts/restrict-template-expressions': [\n 'error',\n { allowNever: true },\n ],\n 'ts/return-await': [\n 'error',\n 'always',\n ],\n 'ts/switch-exhaustiveness-check': [\n 'error',\n { considerDefaultExhaustiveForUnions: true },\n ],\n },\n };\n}\n"],"mappings":";AAEA,SAAgB,wBAA6C;CACzD,OAAO;EACH,iBAAiB,EACb,eAAe;GACX,gBAAgB;GAChB,iBAAiB,QAAQ,IAAI;EACjC,EACJ;EACA,OAAO;GACH,wCAAwC;GACxC,oCAAoC;GAEpC,mBAAmB;GACnB,oBAAoB;GACpB,gCAAgC;GAChC,qBAAqB;GACrB,8BAA8B;GAC9B,sBAAsB;GACtB,wBAAwB;GACxB,oBAAoB;GACpB,qCAAqC;GACrC,2BAA2B,CACvB,SACA,EACI,2BAA2B,CACvB;IACI,MAAM;IACN,MAAM;IACN,SAAS;GACb,CACJ,EACJ,CACJ;GACA,sBAAsB;GACtB,sBAAsB;GACtB,0BAA0B;GAC1B,wBAAwB;GACxB,6CAA6C;GAC7C,yCAAyC;GACzC,oCAAoC;GACpC,oCAAoC;GACpC,uBAAuB;GAEvB,mCAAmC,CAC/B,SACA;IACI,kBAAkB;IAClB,sBAAsB;GAC1B,CACJ;GACA,6BAA6B;GAC7B,oBAAoB;GAEpB,oCAAoC,CAChC,SACA,EAAE,YAAY,KAAK,CACvB;GACA,mBAAmB,CACf,SACA,QACJ;GACA,kCAAkC,CAC9B,SACA,EAAE,oCAAoC,KAAK,CAC/C;EACJ;CACJ;AACJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typefest.d.ts","names":[],"sources":["../../../src/_internals/configs/typefest.ts"],"mappings":";wBAGgB,wBAAwB"}
@@ -1,5 +1,5 @@
1
1
  import typefest from "eslint-plugin-typefest";
2
- // src/_internals/typefest.ts
2
+ // src/_internals/configs/typefest.ts
3
3
  function createTypefestConfig() {
4
4
  return {
5
5
  plugins: { typefest },
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typefest.js","names":[],"sources":["../../../src/_internals/configs/typefest.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport typefest from 'eslint-plugin-typefest';\n\nexport function createTypefestConfig(): TypedFlatConfigItem {\n return {\n plugins: { typefest },\n rules: {\n 'typefest/prefer-ts-extras-is-present-filter': 'error',\n 'typefest/prefer-ts-extras-object-entries': 'error',\n 'typefest/prefer-ts-extras-object-has-own': 'error',\n 'typefest/prefer-ts-extras-object-keys': 'error',\n 'typefest/prefer-ts-extras-object-values': 'error',\n 'typefest/prefer-type-fest-array-values': 'error',\n 'typefest/prefer-type-fest-arrayable': 'error',\n 'typefest/prefer-type-fest-unknown-record': 'error',\n 'typefest/prefer-type-fest-value-of': 'error',\n },\n };\n}\n"],"mappings":";;AAGA,SAAgB,uBAA4C;CACxD,OAAO;EACH,SAAS,EAAE,SAAS;EACpB,OAAO;GACH,+CAA+C;GAC/C,4CAA4C;GAC5C,4CAA4C;GAC5C,yCAAyC;GACzC,2CAA2C;GAC3C,0CAA0C;GAC1C,uCAAuC;GACvC,4CAA4C;GAC5C,sCAAsC;EAC1C;CACJ;AACJ"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from "eslint";
2
+ export declare const commentIndent: Rule.RuleModule;
3
+ //# sourceMappingURL=comment-indent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-indent.d.ts","names":[],"sources":["../../../src/_internals/rules/comment-indent.ts"],"mappings":";qBAmBa,eAAe,KAAK"}
@@ -0,0 +1,58 @@
1
+ // src/_internals/rules/comment-indent.ts
2
+ const closingPunctuators = /* @__PURE__ */ new Set([
3
+ ")",
4
+ "]",
5
+ "}"
6
+ ]);
7
+ const openingPunctuators = /* @__PURE__ */ new Set([
8
+ "(",
9
+ "[",
10
+ "{"
11
+ ]);
12
+ const commentIndent = {
13
+ create(context) {
14
+ const { sourceCode } = context;
15
+ const getIndent = (line) => /^[\t ]*/.exec(sourceCode.lines[line - 1])[0];
16
+ const startsLine = (token) => {
17
+ const previous = sourceCode.getTokenBefore(token, { includeComments: true });
18
+ return !previous || previous.loc.end.line < token.loc.start.line;
19
+ };
20
+ return { Program() {
21
+ for (const comment of sourceCode.getAllComments()) {
22
+ if (!startsLine(comment)) continue;
23
+ let anchor = sourceCode.getTokenBefore(comment, { includeComments: true });
24
+ while ((anchor?.type === "Block" || anchor?.type === "Line") && startsLine(anchor)) anchor = sourceCode.getTokenBefore(anchor, { includeComments: true });
25
+ if (anchor?.type !== "Punctuator" || !openingPunctuators.has(anchor.value)) continue;
26
+ const next = sourceCode.getTokenAfter(comment);
27
+ if (!next || closingPunctuators.has(next.value) || !startsLine(next)) continue;
28
+ const { end, start } = comment.loc;
29
+ if (sourceCode.lines.slice(end.line, next.loc.start.line - 1).some((text) => !text.trim())) continue;
30
+ const indent = getIndent(start.line);
31
+ const expected = getIndent(next.loc.start.line);
32
+ if (indent === expected) continue;
33
+ const commentLines = Array.from({ length: end.line - start.line + 1 }, (_, index) => start.line + index);
34
+ context.report({
35
+ fix: (fixer) => commentLines.filter((line) => sourceCode.lines[line - 1].startsWith(indent)).map((line) => {
36
+ const offset = sourceCode.getIndexFromLoc({
37
+ column: 0,
38
+ line
39
+ });
40
+ return fixer.replaceTextRange([offset, offset + indent.length], expected);
41
+ }),
42
+ loc: comment.loc,
43
+ messageId: "align"
44
+ });
45
+ }
46
+ } };
47
+ },
48
+ meta: {
49
+ docs: { description: "Align comments after an opening bracket with the code that follows them." },
50
+ fixable: "whitespace",
51
+ messages: { align: "Indent this comment like the code that follows it." },
52
+ schema: [],
53
+ type: "layout"
54
+ }
55
+ };
56
+ export { commentIndent };
57
+
58
+ //# sourceMappingURL=comment-indent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-indent.js","names":[],"sources":["../../../src/_internals/rules/comment-indent.ts"],"sourcesContent":["import type {\n AST,\n Rule,\n} from 'eslint';\n\ntype Comment = ReturnType<Rule.RuleContext['sourceCode']['getAllComments']>[number];\n\nconst closingPunctuators = new Set([\n ')',\n ']',\n '}',\n]);\n\nconst openingPunctuators = new Set([\n '(',\n '[',\n '{',\n]);\n\nexport const commentIndent: Rule.RuleModule = {\n create(context) {\n const { sourceCode } = context;\n const getIndent = (line: number) => /^[\\t ]*/.exec(sourceCode.lines[line - 1]!)![0];\n const startsLine = (token: AST.Token | Comment) => {\n const previous = sourceCode.getTokenBefore(token, { includeComments: true });\n return !previous || previous.loc!.end.line < token.loc!.start.line;\n };\n\n return {\n Program() {\n for (const comment of sourceCode.getAllComments()) {\n if (!startsLine(comment)) continue;\n // style/indent lets a comment align with the opening bracket before it, which leaves comments\n // at the outer depth after a fixer nests the bracket's contents one level deeper.\n let anchor = sourceCode.getTokenBefore(comment, { includeComments: true });\n while ((anchor?.type === 'Block' || anchor?.type === 'Line') && startsLine(anchor)) {\n anchor = sourceCode.getTokenBefore(anchor, { includeComments: true });\n }\n\n if (anchor?.type !== 'Punctuator' || !openingPunctuators.has(anchor.value)) continue;\n const next = sourceCode.getTokenAfter(comment);\n if (!next || closingPunctuators.has(next.value) || !startsLine(next)) continue;\n const { end, start } = comment.loc!;\n // style/indent only lets a comment follow the next code when no blank line separates them.\n const gapLines = sourceCode.lines.slice(end.line, next.loc.start.line - 1);\n if (gapLines.some((text) => !text.trim())) continue;\n const indent = getIndent(start.line);\n const expected = getIndent(next.loc.start.line);\n if (indent === expected) continue;\n const commentLines = Array.from(\n { length: end.line - start.line + 1 },\n (_, index) => start.line + index,\n );\n\n context.report({\n // Shift a multiline block comment as a whole so its continuation lines stay aligned.\n fix: (fixer) => commentLines\n .filter((line) => sourceCode.lines[line - 1]!.startsWith(indent))\n .map((line) => {\n const offset = sourceCode.getIndexFromLoc({\n column: 0,\n line,\n });\n\n return fixer.replaceTextRange(\n [\n offset,\n offset + indent.length,\n ],\n expected,\n );\n }),\n loc: comment.loc!,\n messageId: 'align',\n });\n }\n },\n };\n },\n meta: {\n docs: { description: 'Align comments after an opening bracket with the code that follows them.' },\n fixable: 'whitespace',\n messages: { align: 'Indent this comment like the code that follows it.' },\n schema: [],\n type: 'layout',\n },\n};\n"],"mappings":";AAOA,MAAM,qCAAqB,IAAI,IAAI;CAC/B;CACA;CACA;AACJ,CAAC;AAED,MAAM,qCAAqB,IAAI,IAAI;CAC/B;CACA;CACA;AACJ,CAAC;AAED,MAAa,gBAAiC;CAC1C,OAAO,SAAS;EACZ,MAAM,EAAE,eAAe;EACvB,MAAM,aAAa,SAAiB,UAAU,KAAK,WAAW,MAAM,OAAO,EAAG,CAAC,CAAE;EACjF,MAAM,cAAc,UAA+B;GAC/C,MAAM,WAAW,WAAW,eAAe,OAAO,EAAE,iBAAiB,KAAK,CAAC;GAC3E,OAAO,CAAC,YAAY,SAAS,IAAK,IAAI,OAAO,MAAM,IAAK,MAAM;EAClE;EAEA,OAAO,EACH,UAAU;GACN,KAAK,MAAM,WAAW,WAAW,eAAe,GAAG;IAC/C,IAAI,CAAC,WAAW,OAAO,GAAG;IAG1B,IAAI,SAAS,WAAW,eAAe,SAAS,EAAE,iBAAiB,KAAK,CAAC;IACzE,QAAQ,QAAQ,SAAS,WAAW,QAAQ,SAAS,WAAW,WAAW,MAAM,GAC7E,SAAS,WAAW,eAAe,QAAQ,EAAE,iBAAiB,KAAK,CAAC;IAGxE,IAAI,QAAQ,SAAS,gBAAgB,CAAC,mBAAmB,IAAI,OAAO,KAAK,GAAG;IAC5E,MAAM,OAAO,WAAW,cAAc,OAAO;IAC7C,IAAI,CAAC,QAAQ,mBAAmB,IAAI,KAAK,KAAK,KAAK,CAAC,WAAW,IAAI,GAAG;IACtE,MAAM,EAAE,KAAK,UAAU,QAAQ;IAG/B,IADiB,WAAW,MAAM,MAAM,IAAI,MAAM,KAAK,IAAI,MAAM,OAAO,CAC7D,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,KAAK,CAAC,GAAG;IAC3C,MAAM,SAAS,UAAU,MAAM,IAAI;IACnC,MAAM,WAAW,UAAU,KAAK,IAAI,MAAM,IAAI;IAC9C,IAAI,WAAW,UAAU;IACzB,MAAM,eAAe,MAAM,KACvB,EAAE,QAAQ,IAAI,OAAO,MAAM,OAAO,EAAE,IACnC,GAAG,UAAU,MAAM,OAAO,KAC/B;IAEA,QAAQ,OAAO;KAEX,MAAM,UAAU,aACX,QAAQ,SAAS,WAAW,MAAM,OAAO,EAAE,CAAE,WAAW,MAAM,CAAC,CAAC,CAChE,KAAK,SAAS;MACX,MAAM,SAAS,WAAW,gBAAgB;OACtC,QAAQ;OACR;MACJ,CAAC;MAED,OAAO,MAAM,iBACT,CACI,QACA,SAAS,OAAO,MACpB,GACA,QACJ;KACJ,CAAC;KACL,KAAK,QAAQ;KACb,WAAW;IACf,CAAC;GACL;EACJ,EACJ;CACJ;CACA,MAAM;EACF,MAAM,EAAE,aAAa,2EAA2E;EAChG,SAAS;EACT,UAAU,EAAE,OAAO,qDAAqD;EACxE,QAAQ,CAAC;EACT,MAAM;CACV;AACJ"}
@@ -0,0 +1,19 @@
1
+ export declare const customPlugins: {
2
+ rules: {
3
+ 'comment-indent': import("eslint").Rule.RuleModule;
4
+ 'compact-iteration-layout': import("eslint").Rule.RuleModule;
5
+ 'consistent-condition-layout': import("eslint").Rule.RuleModule;
6
+ 'consistent-parameter-layout': import("eslint").Rule.RuleModule;
7
+ 'nitro-route-method-suffix': import("eslint").Rule.RuleModule;
8
+ 'no-composable-in-head-getter': import("eslint").Rule.RuleModule;
9
+ 'no-restricted-nuxt-page-syntax': import("eslint").Rule.RuleModule;
10
+ 'no-restricted-nuxt-server-imports': import("eslint").Rule.RuleModule;
11
+ 'no-restricted-nuxt-syntax': import("eslint").Rule.RuleModule;
12
+ 'no-restricted-test-imports': import("eslint").Rule.RuleModule;
13
+ 'no-silent-catch': import("eslint").Rule.RuleModule;
14
+ 'no-thenable-zod-refinement': import("eslint").Rule.RuleModule;
15
+ 'promise-function-async': import("eslint").Rule.RuleModule;
16
+ 'statement-padding': import("eslint").Rule.RuleModule;
17
+ };
18
+ };
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/_internals/rules/index.ts"],"mappings":"A,qBAoBa"}
@@ -0,0 +1,34 @@
1
+ import { builtinRules } from "eslint/use-at-your-own-risk";
2
+ import { commentIndent } from "./comment-indent.js";
3
+ import { compactIterationLayout } from "./compact-iteration-layout.js";
4
+ import { consistentConditionLayout } from "./consistent-condition-layout.js";
5
+ import { consistentParameterLayout } from "./consistent-parameter-layout.js";
6
+ import { nitroRouteMethodSuffix } from "./nitro-route-method-suffix.js";
7
+ import { noComposableInHeadGetter } from "./no-composable-in-head-getter.js";
8
+ import { noSilentCatch } from "./no-silent-catch.js";
9
+ import { noThenableZodRefinement } from "./no-thenable-zod-refinement.js";
10
+ import { promiseFunctionAsync } from "./promise-function-async.js";
11
+ import { statementPadding } from "./statement-padding.js";
12
+ // src/_internals/rules/index.ts
13
+ const coreRules = builtinRules;
14
+ const noRestrictedImports = coreRules.get("no-restricted-imports");
15
+ const noRestrictedSyntax = coreRules.get("no-restricted-syntax");
16
+ const customPlugins = { rules: {
17
+ "comment-indent": commentIndent,
18
+ "compact-iteration-layout": compactIterationLayout,
19
+ "consistent-condition-layout": consistentConditionLayout,
20
+ "consistent-parameter-layout": consistentParameterLayout,
21
+ "nitro-route-method-suffix": nitroRouteMethodSuffix,
22
+ "no-composable-in-head-getter": noComposableInHeadGetter,
23
+ "no-restricted-nuxt-page-syntax": noRestrictedSyntax,
24
+ "no-restricted-nuxt-server-imports": noRestrictedImports,
25
+ "no-restricted-nuxt-syntax": noRestrictedSyntax,
26
+ "no-restricted-test-imports": noRestrictedImports,
27
+ "no-silent-catch": noSilentCatch,
28
+ "no-thenable-zod-refinement": noThenableZodRefinement,
29
+ "promise-function-async": promiseFunctionAsync,
30
+ "statement-padding": statementPadding
31
+ } };
32
+ export { customPlugins };
33
+
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/_internals/rules/index.ts"],"sourcesContent":["import { builtinRules } from 'eslint/use-at-your-own-risk';\n\nimport { commentIndent } from './comment-indent';\nimport { compactIterationLayout } from './compact-iteration-layout';\nimport { consistentConditionLayout } from './consistent-condition-layout';\nimport { consistentParameterLayout } from './consistent-parameter-layout';\nimport { nitroRouteMethodSuffix } from './nitro-route-method-suffix';\nimport { noComposableInHeadGetter } from './no-composable-in-head-getter';\nimport { noSilentCatch } from './no-silent-catch';\nimport { noThenableZodRefinement } from './no-thenable-zod-refinement';\nimport { promiseFunctionAsync } from './promise-function-async';\nimport { statementPadding } from './statement-padding';\n\n// Each scope adds its restrictions under its own name: a later config replaces a rule's whole option list,\n// so sharing the core rule would drop the restrictions of every broader scope.\n// eslint-disable-next-line ts/no-deprecated -- No supported API exposes core rules yet; typescript-eslint uses it too.\nconst coreRules = builtinRules;\nconst noRestrictedImports = coreRules.get('no-restricted-imports')!;\nconst noRestrictedSyntax = coreRules.get('no-restricted-syntax')!;\n\nexport const customPlugins = {\n rules: {\n 'comment-indent': commentIndent,\n 'compact-iteration-layout': compactIterationLayout,\n 'consistent-condition-layout': consistentConditionLayout,\n 'consistent-parameter-layout': consistentParameterLayout,\n 'nitro-route-method-suffix': nitroRouteMethodSuffix,\n 'no-composable-in-head-getter': noComposableInHeadGetter,\n 'no-restricted-nuxt-page-syntax': noRestrictedSyntax,\n 'no-restricted-nuxt-server-imports': noRestrictedImports,\n 'no-restricted-nuxt-syntax': noRestrictedSyntax,\n 'no-restricted-test-imports': noRestrictedImports,\n 'no-silent-catch': noSilentCatch,\n 'no-thenable-zod-refinement': noThenableZodRefinement,\n 'promise-function-async': promiseFunctionAsync,\n 'statement-padding': statementPadding,\n },\n};\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,YAAY;AAClB,MAAM,sBAAsB,UAAU,IAAI,uBAAuB;AACjE,MAAM,qBAAqB,UAAU,IAAI,sBAAsB;AAE/D,MAAa,gBAAgB,EACzB,OAAO;CACH,kBAAkB;CAClB,4BAA4B;CAC5B,+BAA+B;CAC/B,+BAA+B;CAC/B,6BAA6B;CAC7B,gCAAgC;CAChC,kCAAkC;CAClC,qCAAqC;CACrC,6BAA6B;CAC7B,8BAA8B;CAC9B,mBAAmB;CACnB,8BAA8B;CAC9B,0BAA0B;CAC1B,qBAAqB;AACzB,EACJ"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from "eslint";
2
+ export declare const nitroRouteMethodSuffix: Rule.RuleModule;
3
+ //# sourceMappingURL=nitro-route-method-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nitro-route-method-suffix.d.ts","names":[],"sources":["../../../src/_internals/rules/nitro-route-method-suffix.ts"],"mappings":";qBAMa,wBAAwB,KAAK"}
@@ -0,0 +1,25 @@
1
+ import { basename } from "node:path";
2
+ // src/_internals/rules/nitro-route-method-suffix.ts
3
+ const methodSuffixPattern = /\.(?:delete|get|head|options|patch|post|put)$/;
4
+ const nitroRouteMethodSuffix = {
5
+ create(context) {
6
+ return { Program(node) {
7
+ const name = basename(context.filename).replace(/\.[cm]?[jt]s$/, "");
8
+ if (methodSuffixPattern.test(name)) return;
9
+ context.report({
10
+ data: { name },
11
+ loc: node.loc.start,
12
+ messageId: "missing"
13
+ });
14
+ } };
15
+ },
16
+ meta: {
17
+ docs: { description: "Require an HTTP method suffix on Nitro route file names." },
18
+ messages: { missing: "Name this route `{{ name }}.get.ts`, `{{ name }}.post.ts`, or another method suffix; without one, the route accepts every HTTP method." },
19
+ schema: [],
20
+ type: "problem"
21
+ }
22
+ };
23
+ export { nitroRouteMethodSuffix };
24
+
25
+ //# sourceMappingURL=nitro-route-method-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nitro-route-method-suffix.js","names":[],"sources":["../../../src/_internals/rules/nitro-route-method-suffix.ts"],"sourcesContent":["import { basename } from 'node:path';\n\nimport type { Rule } from 'eslint';\n\nconst methodSuffixPattern = /\\.(?:delete|get|head|options|patch|post|put)$/;\n\nexport const nitroRouteMethodSuffix: Rule.RuleModule = {\n create(context) {\n return {\n Program(node) {\n const name = basename(context.filename).replace(/\\.[cm]?[jt]s$/, '');\n if (methodSuffixPattern.test(name)) return;\n context.report({\n data: { name },\n loc: node.loc.start,\n messageId: 'missing',\n });\n },\n };\n },\n meta: {\n docs: { description: 'Require an HTTP method suffix on Nitro route file names.' },\n messages: { missing: 'Name this route `{{ name }}.get.ts`, `{{ name }}.post.ts`, or another method suffix; without one, the route accepts every HTTP method.' },\n schema: [],\n type: 'problem',\n },\n};\n"],"mappings":";;AAIA,MAAM,sBAAsB;AAE5B,MAAa,yBAA0C;CACnD,OAAO,SAAS;EACZ,OAAO,EACH,QAAQ,MAAM;GACV,MAAM,OAAO,SAAS,QAAQ,QAAQ,CAAC,CAAC,QAAQ,iBAAiB,EAAE;GACnE,IAAI,oBAAoB,KAAK,IAAI,GAAG;GACpC,QAAQ,OAAO;IACX,MAAM,EAAE,KAAK;IACb,KAAK,KAAK,IAAI;IACd,WAAW;GACf,CAAC;EACL,EACJ;CACJ;CACA,MAAM;EACF,MAAM,EAAE,aAAa,2DAA2D;EAChF,UAAU,EAAE,SAAS,yIAAyI;EAC9J,QAAQ,CAAC;EACT,MAAM;CACV;AACJ"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from "eslint";
2
+ export declare const noComposableInHeadGetter: Rule.RuleModule;
3
+ //# sourceMappingURL=no-composable-in-head-getter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-composable-in-head-getter.d.ts","names":[],"sources":["../../../src/_internals/rules/no-composable-in-head-getter.ts"],"mappings":";qBAaa,0BAA0B,KAAK"}
@@ -0,0 +1,41 @@
1
+ // src/_internals/rules/no-composable-in-head-getter.ts
2
+ const headComposables = /* @__PURE__ */ new Set([
3
+ "useHead",
4
+ "useHeadSafe",
5
+ "useSeoMeta",
6
+ "useServerHead",
7
+ "useServerHeadSafe",
8
+ "useServerSeoMeta"
9
+ ]);
10
+ const composablePattern = /^use[A-Z]/;
11
+ const noComposableInHeadGetter = {
12
+ create(context) {
13
+ return { CallExpression(node) {
14
+ if (node.callee.type !== "Identifier" || !composablePattern.test(node.callee.name)) return;
15
+ let insideFunction = false;
16
+ for (const parent of context.sourceCode.getAncestors(node).reverse()) {
17
+ if (parent.type === "ArrowFunctionExpression" || parent.type === "FunctionExpression") insideFunction = true;
18
+ if (insideFunction && parent.type === "CallExpression" && parent.callee.type === "Identifier" && headComposables.has(parent.callee.name)) {
19
+ context.report({
20
+ data: {
21
+ composable: node.callee.name,
22
+ head: parent.callee.name
23
+ },
24
+ messageId: "getter",
25
+ node
26
+ });
27
+ return;
28
+ }
29
+ }
30
+ } };
31
+ },
32
+ meta: {
33
+ docs: { description: "Disallow calling composables inside `useHead`/`useSeoMeta` getters." },
34
+ messages: { getter: "`{{ composable }}()` runs when the `{{ head }}` getter is evaluated after setup, outside the component context. Call it in setup and use its result in the getter." },
35
+ schema: [],
36
+ type: "problem"
37
+ }
38
+ };
39
+ export { noComposableInHeadGetter };
40
+
41
+ //# sourceMappingURL=no-composable-in-head-getter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-composable-in-head-getter.js","names":[],"sources":["../../../src/_internals/rules/no-composable-in-head-getter.ts"],"sourcesContent":["import type { Rule } from 'eslint';\n\nconst headComposables = new Set([\n 'useHead',\n 'useHeadSafe',\n 'useSeoMeta',\n 'useServerHead',\n 'useServerHeadSafe',\n 'useServerSeoMeta',\n]);\n\nconst composablePattern = /^use[A-Z]/;\n\nexport const noComposableInHeadGetter: Rule.RuleModule = {\n create(context) {\n return {\n CallExpression(node) {\n if (node.callee.type !== 'Identifier' || !composablePattern.test(node.callee.name)) return;\n let insideFunction = false;\n for (const parent of context.sourceCode.getAncestors(node).reverse()) {\n if (parent.type === 'ArrowFunctionExpression' || parent.type === 'FunctionExpression') {\n insideFunction = true;\n }\n\n if (\n insideFunction\n && parent.type === 'CallExpression'\n && parent.callee.type === 'Identifier'\n && headComposables.has(parent.callee.name)\n ) {\n context.report({\n data: {\n composable: node.callee.name,\n head: parent.callee.name,\n },\n messageId: 'getter',\n node,\n });\n\n return;\n }\n }\n },\n };\n },\n meta: {\n docs: { description: 'Disallow calling composables inside `useHead`/`useSeoMeta` getters.' },\n messages: { getter: '`{{ composable }}()` runs when the `{{ head }}` getter is evaluated after setup, outside the component context. Call it in setup and use its result in the getter.' },\n schema: [],\n type: 'problem',\n },\n};\n"],"mappings":";AAEA,MAAM,kCAAkB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AAED,MAAM,oBAAoB;AAE1B,MAAa,2BAA4C;CACrD,OAAO,SAAS;EACZ,OAAO,EACH,eAAe,MAAM;GACjB,IAAI,KAAK,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,KAAK,KAAK,OAAO,IAAI,GAAG;GACpF,IAAI,iBAAiB;GACrB,KAAK,MAAM,UAAU,QAAQ,WAAW,aAAa,IAAI,CAAC,CAAC,QAAQ,GAAG;IAClE,IAAI,OAAO,SAAS,6BAA6B,OAAO,SAAS,sBAC7D,iBAAiB;IAGrB,IACI,kBACG,OAAO,SAAS,oBAChB,OAAO,OAAO,SAAS,gBACvB,gBAAgB,IAAI,OAAO,OAAO,IAAI,GAC3C;KACE,QAAQ,OAAO;MACX,MAAM;OACF,YAAY,KAAK,OAAO;OACxB,MAAM,OAAO,OAAO;MACxB;MACA,WAAW;MACX;KACJ,CAAC;KAED;IACJ;GACJ;EACJ,EACJ;CACJ;CACA,MAAM;EACF,MAAM,EAAE,aAAa,sEAAsE;EAC3F,UAAU,EAAE,QAAQ,qKAAqK;EACzL,QAAQ,CAAC;EACT,MAAM;CACV;AACJ"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from "eslint";
2
+ export declare const noSilentCatch: Rule.RuleModule;
3
+ //# sourceMappingURL=no-silent-catch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-silent-catch.d.ts","names":[],"sources":["../../../src/_internals/rules/no-silent-catch.ts"],"mappings":";qBAoBa,eAAe,KAAK"}