@eienjs/eslint-config 1.2.2 → 1.3.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 (76) hide show
  1. package/dist/cli/constants.js +74 -0
  2. package/dist/cli/constants_generated.js +13 -0
  3. package/dist/cli/index.d.ts +1 -1
  4. package/dist/cli/index.js +3 -268
  5. package/dist/cli/run.js +77 -0
  6. package/dist/cli/stages/update_eslint_files.js +41 -0
  7. package/dist/cli/stages/update_package_json.js +46 -0
  8. package/dist/cli/stages/update_vscode_settings.js +30 -0
  9. package/dist/cli/utils.js +23 -0
  10. package/dist/configs/adonisjs.d.ts +6 -0
  11. package/dist/configs/adonisjs.js +115 -0
  12. package/dist/configs/astro.d.ts +6 -0
  13. package/dist/configs/astro.js +52 -0
  14. package/dist/configs/command.d.ts +6 -0
  15. package/dist/configs/command.js +12 -0
  16. package/dist/configs/comments.d.ts +6 -0
  17. package/dist/configs/comments.js +19 -0
  18. package/dist/configs/disables.d.ts +6 -0
  19. package/dist/configs/disables.js +85 -0
  20. package/dist/configs/formatters.d.ts +6 -0
  21. package/dist/configs/formatters.js +134 -0
  22. package/dist/configs/ignores.d.ts +6 -0
  23. package/dist/configs/ignores.js +12 -0
  24. package/dist/configs/imports.d.ts +6 -0
  25. package/dist/configs/imports.js +28 -0
  26. package/dist/configs/index.d.ts +25 -95
  27. package/dist/configs/index.js +25 -1
  28. package/dist/configs/javascript.d.ts +6 -0
  29. package/dist/configs/javascript.js +289 -0
  30. package/dist/configs/jsdoc.d.ts +6 -0
  31. package/dist/configs/jsdoc.js +34 -0
  32. package/dist/configs/jsonc.d.ts +6 -0
  33. package/dist/configs/jsonc.js +71 -0
  34. package/dist/configs/markdown.d.ts +6 -0
  35. package/dist/configs/markdown.js +67 -0
  36. package/dist/configs/node.d.ts +6 -0
  37. package/dist/configs/node.js +22 -0
  38. package/dist/configs/nuxt.d.ts +6 -0
  39. package/dist/configs/nuxt.js +137 -0
  40. package/dist/configs/perfectionist.d.ts +12 -0
  41. package/dist/configs/perfectionist.js +56 -0
  42. package/dist/configs/pnpm.d.ts +6 -0
  43. package/dist/configs/pnpm.js +33 -0
  44. package/dist/configs/regexp.d.ts +6 -0
  45. package/dist/configs/regexp.js +21 -0
  46. package/dist/configs/sort.d.ts +18 -0
  47. package/dist/configs/sort.js +239 -0
  48. package/dist/configs/stylistic.d.ts +8 -0
  49. package/dist/configs/stylistic.js +76 -0
  50. package/dist/configs/test.d.ts +6 -0
  51. package/dist/configs/test.js +42 -0
  52. package/dist/configs/toml.d.ts +6 -0
  53. package/dist/configs/toml.js +45 -0
  54. package/dist/configs/typescript.d.ts +6 -0
  55. package/dist/configs/typescript.js +213 -0
  56. package/dist/configs/unicorn.d.ts +6 -0
  57. package/dist/configs/unicorn.js +42 -0
  58. package/dist/configs/vue.d.ts +6 -0
  59. package/dist/configs/vue.js +206 -0
  60. package/dist/configs/yaml.d.ts +6 -0
  61. package/dist/configs/yaml.js +83 -0
  62. package/dist/factory.d.ts +17 -0
  63. package/dist/factory.js +161 -0
  64. package/dist/globs.d.ts +32 -0
  65. package/dist/globs.js +89 -0
  66. package/dist/index.d.ts +5 -85
  67. package/dist/index.js +3 -133
  68. package/dist/package.js +5 -0
  69. package/dist/plugins.js +9 -0
  70. package/dist/{types-ClRJcxpY.d.ts → typegen.d.ts} +379 -745
  71. package/dist/types.d.ts +404 -0
  72. package/dist/utils.d.ts +42 -0
  73. package/dist/utils.js +62 -0
  74. package/dist/vendored/prettier_types.d.ts +121 -0
  75. package/package.json +31 -24
  76. package/dist/configs-D_4UWxl6.js +0 -2192
@@ -0,0 +1,45 @@
1
+ import { GLOB_TOML } from "../globs.js";
2
+ import { interopDefault } from "../utils.js";
3
+
4
+ //#region src/configs/toml.ts
5
+ async function toml(options = {}) {
6
+ const { files = [GLOB_TOML], overrides = {}, stylistic = true } = options;
7
+ const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
8
+ const [pluginToml, parserToml] = await Promise.all([interopDefault(import("eslint-plugin-toml")), interopDefault(import("toml-eslint-parser"))]);
9
+ return [{
10
+ name: "eienjs/toml/setup",
11
+ plugins: { toml: pluginToml }
12
+ }, {
13
+ files,
14
+ languageOptions: { parser: parserToml },
15
+ name: "eienjs/toml/rules",
16
+ rules: {
17
+ "@stylistic/spaced-comment": "off",
18
+ "toml/comma-style": "error",
19
+ "toml/keys-order": "error",
20
+ "toml/no-space-dots": "error",
21
+ "toml/no-unreadable-number-separator": "error",
22
+ "toml/precision-of-fractional-seconds": "error",
23
+ "toml/precision-of-integer": "error",
24
+ "toml/tables-order": "error",
25
+ "toml/vue-custom-block/no-parsing-error": "error",
26
+ ...stylistic ? {
27
+ "toml/array-bracket-newline": "error",
28
+ "toml/array-bracket-spacing": "error",
29
+ "toml/array-element-newline": "error",
30
+ "toml/indent": ["error", indent === "tab" ? 2 : indent],
31
+ "toml/inline-table-curly-spacing": "error",
32
+ "toml/key-spacing": "error",
33
+ "toml/padding-line-between-pairs": "error",
34
+ "toml/padding-line-between-tables": "error",
35
+ "toml/quoted-keys": "error",
36
+ "toml/spaced-comment": "error",
37
+ "toml/table-bracket-spacing": "error"
38
+ } : {},
39
+ ...overrides
40
+ }
41
+ }];
42
+ }
43
+
44
+ //#endregion
45
+ export { toml };
@@ -0,0 +1,6 @@
1
+ import { OptionsComponentExts, OptionsFiles, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, TypedFlatConfigItem } from "../types.js";
2
+
3
+ //#region src/configs/typescript.d.ts
4
+ declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
5
+ //#endregion
6
+ export { typescript };
@@ -0,0 +1,213 @@
1
+ import { GLOB_ASTRO_TS, GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from "../globs.js";
2
+ import { interopDefault } from "../utils.js";
3
+ import { pluginAntfu } from "../plugins.js";
4
+ import process from "node:process";
5
+
6
+ //#region src/configs/typescript.ts
7
+ async function typescript(options = {}) {
8
+ const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic = true } = options;
9
+ const files = options.files ?? [
10
+ GLOB_TS,
11
+ GLOB_TSX,
12
+ ...componentExts.map((ext) => `**/*.${ext}`)
13
+ ];
14
+ const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
15
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
16
+ const tsconfigPath = options.tsconfigPath ?? void 0;
17
+ const isTypeAware = Boolean(tsconfigPath);
18
+ const typeAwareRules = {
19
+ "dot-notation": "off",
20
+ "no-implied-eval": "off",
21
+ "@typescript-eslint/await-thenable": "error",
22
+ "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
23
+ "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
24
+ "@typescript-eslint/explicit-member-accessibility": "error",
25
+ "@typescript-eslint/explicit-module-boundary-types": "error",
26
+ "@typescript-eslint/naming-convention": [
27
+ "error",
28
+ {
29
+ format: ["camelCase", "UPPER_CASE"],
30
+ leadingUnderscore: "allowSingleOrDouble",
31
+ modifiers: ["const"],
32
+ selector: "variable",
33
+ trailingUnderscore: "allowSingleOrDouble",
34
+ types: ["string", "number"]
35
+ },
36
+ {
37
+ format: null,
38
+ leadingUnderscore: "allowSingleOrDouble",
39
+ selector: "objectLiteralProperty",
40
+ trailingUnderscore: "allowSingleOrDouble"
41
+ },
42
+ {
43
+ format: ["PascalCase"],
44
+ leadingUnderscore: "allowSingleOrDouble",
45
+ selector: "typeLike",
46
+ trailingUnderscore: "allowSingleOrDouble"
47
+ },
48
+ {
49
+ format: null,
50
+ modifiers: ["destructured"],
51
+ selector: "variable"
52
+ },
53
+ {
54
+ format: null,
55
+ selector: "typeProperty"
56
+ },
57
+ {
58
+ format: ["PascalCase"],
59
+ selector: "class"
60
+ },
61
+ {
62
+ custom: {
63
+ match: false,
64
+ regex: "^I[A-Z]"
65
+ },
66
+ format: ["PascalCase"],
67
+ selector: "interface"
68
+ },
69
+ {
70
+ selector: "variable",
71
+ format: [
72
+ "camelCase",
73
+ "UPPER_CASE",
74
+ "PascalCase"
75
+ ],
76
+ leadingUnderscore: "allow"
77
+ }
78
+ ],
79
+ "@typescript-eslint/no-floating-promises": "error",
80
+ "@typescript-eslint/no-for-in-array": "error",
81
+ "@typescript-eslint/no-implied-eval": "error",
82
+ "@typescript-eslint/no-misused-promises": "error",
83
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
84
+ "@typescript-eslint/no-unsafe-argument": "error",
85
+ "@typescript-eslint/no-unsafe-assignment": "error",
86
+ "@typescript-eslint/no-unsafe-call": "error",
87
+ "@typescript-eslint/no-unsafe-member-access": "error",
88
+ "@typescript-eslint/no-unsafe-return": "error",
89
+ "@typescript-eslint/prefer-nullish-coalescing": ["error", { ignorePrimitives: { string: true } }],
90
+ "@typescript-eslint/prefer-optional-chain": "error",
91
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
92
+ "@typescript-eslint/promise-function-async": "error",
93
+ "@typescript-eslint/restrict-plus-operands": "error",
94
+ "@typescript-eslint/restrict-template-expressions": "error",
95
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
96
+ "@typescript-eslint/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
97
+ "@typescript-eslint/no-empty-object-type": "off",
98
+ "@typescript-eslint/no-unused-vars": ["error", {
99
+ "args": "all",
100
+ "argsIgnorePattern": "^_",
101
+ "caughtErrors": "all",
102
+ "caughtErrorsIgnorePattern": "^_",
103
+ "destructuredArrayIgnorePattern": "^_",
104
+ "varsIgnorePattern": "^_",
105
+ "ignoreRestSiblings": true
106
+ }],
107
+ "@typescript-eslint/no-non-null-assertion": "off"
108
+ };
109
+ const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
110
+ function makeParser(typeAware, files$1, ignores) {
111
+ return {
112
+ files: files$1,
113
+ ...ignores ? { ignores } : {},
114
+ languageOptions: {
115
+ parser: parserTs,
116
+ parserOptions: {
117
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
118
+ sourceType: "module",
119
+ ...typeAware ? {
120
+ projectService: {
121
+ allowDefaultProject: ["./*.js"],
122
+ defaultProject: tsconfigPath
123
+ },
124
+ tsconfigRootDir: process.cwd()
125
+ } : {},
126
+ ...parserOptions
127
+ }
128
+ },
129
+ name: `eienjs/typescript/${typeAware ? "type-aware-parser" : "parser"}`
130
+ };
131
+ }
132
+ return [
133
+ {
134
+ name: "eienjs/typescript/setup",
135
+ plugins: {
136
+ "antfu": pluginAntfu,
137
+ "@typescript-eslint": pluginTs
138
+ }
139
+ },
140
+ ...isTypeAware ? [makeParser(false, files), makeParser(true, filesTypeAware, ignoresTypeAware)] : [makeParser(false, files)],
141
+ {
142
+ files,
143
+ name: "eienjs/typescript/rules",
144
+ rules: {
145
+ ...pluginTs.configs["eslint-recommended"].overrides?.[0].rules,
146
+ ...pluginTs.configs.strict.rules,
147
+ ...stylistic ? pluginTs.configs.stylistic.rules : {},
148
+ "no-dupe-class-members": "off",
149
+ "no-redeclare": "off",
150
+ "no-use-before-define": "off",
151
+ "no-useless-constructor": "off",
152
+ "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
153
+ "@typescript-eslint/consistent-type-assertions": "error",
154
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
155
+ "@typescript-eslint/consistent-type-imports": ["error", {
156
+ disallowTypeAnnotations: false,
157
+ fixStyle: "separate-type-imports",
158
+ prefer: "type-imports"
159
+ }],
160
+ "@typescript-eslint/default-param-last": "error",
161
+ "@typescript-eslint/method-signature-style": ["error", "property"],
162
+ "@typescript-eslint/no-dupe-class-members": "error",
163
+ "@typescript-eslint/no-dynamic-delete": "off",
164
+ "@typescript-eslint/no-empty-object-type": "off",
165
+ "@typescript-eslint/no-explicit-any": "off",
166
+ "@typescript-eslint/no-extraneous-class": "off",
167
+ "@typescript-eslint/no-import-type-side-effects": "error",
168
+ "@typescript-eslint/no-invalid-void-type": "off",
169
+ "@typescript-eslint/no-non-null-assertion": "off",
170
+ "@typescript-eslint/no-redeclare": ["error", { builtinGlobals: false }],
171
+ "@typescript-eslint/no-require-imports": "error",
172
+ "@typescript-eslint/no-unused-expressions": ["error", {
173
+ allowShortCircuit: true,
174
+ allowTaggedTemplates: true,
175
+ allowTernary: true
176
+ }],
177
+ "@typescript-eslint/no-unused-vars": ["error", {
178
+ "args": "all",
179
+ "argsIgnorePattern": "^_",
180
+ "caughtErrors": "all",
181
+ "caughtErrorsIgnorePattern": "^_",
182
+ "destructuredArrayIgnorePattern": "^_",
183
+ "varsIgnorePattern": "^_",
184
+ "ignoreRestSiblings": true
185
+ }],
186
+ "@typescript-eslint/no-use-before-define": ["error", {
187
+ classes: false,
188
+ functions: false,
189
+ variables: true
190
+ }],
191
+ "@typescript-eslint/no-useless-constructor": "off",
192
+ "@typescript-eslint/no-wrapper-object-types": "error",
193
+ "@typescript-eslint/triple-slash-reference": "off",
194
+ "@typescript-eslint/unified-signatures": "off",
195
+ ...overrides
196
+ }
197
+ },
198
+ ...isTypeAware ? [{
199
+ files: filesTypeAware,
200
+ ignores: ignoresTypeAware,
201
+ name: "eienjs/typescript/rules-type-aware",
202
+ rules: {
203
+ ...pluginTs.configs["strict-type-checked"].rules,
204
+ ...stylistic ? pluginTs.configs["stylistic-type-checked"].rules : {},
205
+ ...typeAwareRules,
206
+ ...overridesTypeAware
207
+ }
208
+ }] : []
209
+ ];
210
+ }
211
+
212
+ //#endregion
213
+ export { typescript };
@@ -0,0 +1,6 @@
1
+ import { OptionsOverrides, TypedFlatConfigItem } from "../types.js";
2
+
3
+ //#region src/configs/unicorn.d.ts
4
+ declare function unicorn(options?: OptionsOverrides): TypedFlatConfigItem[];
5
+ //#endregion
6
+ export { unicorn };
@@ -0,0 +1,42 @@
1
+ import { GLOB_SRC } from "../globs.js";
2
+ import { pluginUnicorn } from "../plugins.js";
3
+
4
+ //#region src/configs/unicorn.ts
5
+ function unicorn(options = {}) {
6
+ const { overrides = {} } = options;
7
+ return [{
8
+ name: "eienjs/unicorn/rules",
9
+ plugins: { unicorn: pluginUnicorn },
10
+ rules: {
11
+ ...pluginUnicorn.configs.recommended.rules,
12
+ "unicorn/no-this-assignment": "off",
13
+ "unicorn/consistent-destructuring": "error",
14
+ "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
15
+ "unicorn/no-null": "off",
16
+ "unicorn/no-static-only-class": "off",
17
+ "unicorn/numeric-separators-style": "off",
18
+ "unicorn/prefer-dom-node-append": "off",
19
+ "unicorn/prefer-dom-node-dataset": "off",
20
+ "unicorn/prefer-dom-node-remove": "off",
21
+ "unicorn/prefer-dom-node-text-content": "off",
22
+ "unicorn/prefer-modern-dom-apis": "off",
23
+ "unicorn/prefer-query-selector": "off",
24
+ "unicorn/prefer-switch": ["error", { emptyDefaultCase: "do-nothing-comment" }],
25
+ "unicorn/prevent-abbreviations": "off",
26
+ "unicorn/no-thenable": "off",
27
+ "unicorn/expiring-todo-comments": "off",
28
+ "unicorn/no-array-reduce": "off",
29
+ "unicorn/prefer-export-from": "off",
30
+ "unicorn/prefer-top-level-await": "off",
31
+ "unicorn/filename-case": "off",
32
+ ...overrides
33
+ }
34
+ }, {
35
+ files: [GLOB_SRC],
36
+ name: "eienjs/unicorn/special-rules",
37
+ rules: { "unicorn/filename-case": ["error", { case: "snakeCase" }] }
38
+ }];
39
+ }
40
+
41
+ //#endregion
42
+ export { unicorn };
@@ -0,0 +1,6 @@
1
+ import { OptionsFiles, OptionsHasTypeScript, OptionsOverrides, OptionsStylistic, OptionsVue, TypedFlatConfigItem } from "../types.js";
2
+
3
+ //#region src/configs/vue.d.ts
4
+ declare function vue(options?: OptionsVue & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
5
+ //#endregion
6
+ export { vue };
@@ -0,0 +1,206 @@
1
+ import { GLOB_SRC, GLOB_VUE } from "../globs.js";
2
+ import { interopDefault } from "../utils.js";
3
+ import { mergeProcessors } from "eslint-merge-processors";
4
+
5
+ //#region src/configs/vue.ts
6
+ async function vue(options = {}) {
7
+ const { files = [GLOB_VUE], overrides = {}, stylistic = true, typescript, componentNameInTemplateCasingOnlyRegistered = false, componentNameInTemplateCasingIgnores = [], componentNameInTemplateCasingGlobals = [] } = options;
8
+ const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
9
+ const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
10
+ const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
11
+ interopDefault(import("eslint-plugin-vue")),
12
+ interopDefault(import("vue-eslint-parser")),
13
+ interopDefault(import("eslint-processor-vue-blocks"))
14
+ ]);
15
+ return [
16
+ {
17
+ languageOptions: { globals: {
18
+ computed: "readonly",
19
+ defineEmits: "readonly",
20
+ defineExpose: "readonly",
21
+ defineProps: "readonly",
22
+ onMounted: "readonly",
23
+ onUnmounted: "readonly",
24
+ reactive: "readonly",
25
+ ref: "readonly",
26
+ shallowReactive: "readonly",
27
+ shallowRef: "readonly",
28
+ toRef: "readonly",
29
+ toRefs: "readonly",
30
+ watch: "readonly",
31
+ watchEffect: "readonly"
32
+ } },
33
+ name: "eienjs/vue/setup",
34
+ plugins: { vue: pluginVue }
35
+ },
36
+ {
37
+ files,
38
+ languageOptions: {
39
+ parser: parserVue,
40
+ parserOptions: {
41
+ ecmaFeatures: { jsx: true },
42
+ extraFileExtensions: [".vue"],
43
+ parser: typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
44
+ sourceType: "module"
45
+ }
46
+ },
47
+ name: "eienjs/vue/rules",
48
+ processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([pluginVue.processors[".vue"], processorVueBlocks({
49
+ ...sfcBlocks,
50
+ blocks: {
51
+ styles: true,
52
+ ...sfcBlocks.blocks
53
+ }
54
+ })]),
55
+ rules: {
56
+ ...pluginVue.configs.base.rules,
57
+ ...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({
58
+ ...acc,
59
+ ...c
60
+ }), {}),
61
+ ...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({
62
+ ...acc,
63
+ ...c
64
+ }), {}),
65
+ ...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({
66
+ ...acc,
67
+ ...c
68
+ }), {}),
69
+ "vue/block-lang": ["error", { script: { lang: "ts" } }],
70
+ "vue/block-order": ["error", { order: [
71
+ "script",
72
+ "template",
73
+ "style"
74
+ ] }],
75
+ "vue/component-api-style": ["error", ["script-setup"]],
76
+ "vue/component-name-in-template-casing": [
77
+ "error",
78
+ "PascalCase",
79
+ {
80
+ registeredComponentsOnly: componentNameInTemplateCasingOnlyRegistered,
81
+ ignores: componentNameInTemplateCasingIgnores,
82
+ globals: componentNameInTemplateCasingGlobals
83
+ }
84
+ ],
85
+ "vue/component-options-name-casing": ["error", "PascalCase"],
86
+ "vue/custom-event-name-casing": ["error", "camelCase"],
87
+ "vue/define-macros-order": ["error", { order: [
88
+ "defineOptions",
89
+ "defineProps",
90
+ "defineEmits",
91
+ "defineSlots"
92
+ ] }],
93
+ "vue/define-props-declaration": ["error", "runtime"],
94
+ "vue/dot-location": ["error", "property"],
95
+ "vue/dot-notation": ["error", { allowKeywords: true }],
96
+ "vue/eqeqeq": ["error", "smart"],
97
+ "vue/html-indent": ["error", indent],
98
+ "vue/html-quotes": ["error", "double"],
99
+ "vue/max-attributes-per-line": "off",
100
+ "vue/multi-word-component-names": "off",
101
+ "vue/no-dupe-keys": "off",
102
+ "vue/no-empty-component-block": "error",
103
+ "vue/no-empty-pattern": "error",
104
+ "vue/no-irregular-whitespace": "error",
105
+ "vue/no-loss-of-precision": "error",
106
+ "vue/no-multiple-objects-in-class": "error",
107
+ "vue/no-ref-object-reactivity-loss": "error",
108
+ "vue/no-required-prop-with-default": "error",
109
+ "vue/no-restricted-syntax": [
110
+ "error",
111
+ "DebuggerStatement",
112
+ "LabeledStatement",
113
+ "WithStatement"
114
+ ],
115
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
116
+ "vue/no-root-v-if": "error",
117
+ "vue/no-setup-props-reactivity-loss": "off",
118
+ "vue/no-sparse-arrays": "error",
119
+ "vue/no-template-target-blank": "error",
120
+ "vue/no-unused-properties": "error",
121
+ "vue/no-unused-refs": "error",
122
+ "vue/no-use-v-else-with-v-for": "error",
123
+ "vue/no-useless-mustaches": "error",
124
+ "vue/no-useless-v-bind": "error",
125
+ "vue/no-v-html": "off",
126
+ "vue/object-shorthand": [
127
+ "error",
128
+ "always",
129
+ {
130
+ avoidQuotes: true,
131
+ ignoreConstructors: false
132
+ }
133
+ ],
134
+ "vue/prefer-separate-static-class": "error",
135
+ "vue/prefer-template": "error",
136
+ "vue/prefer-true-attribute-shorthand": "error",
137
+ "vue/prop-name-casing": ["error", "camelCase"],
138
+ "vue/require-typed-ref": "error",
139
+ "vue/space-infix-ops": "error",
140
+ "vue/space-unary-ops": ["error", {
141
+ nonwords: false,
142
+ words: true
143
+ }],
144
+ "vue/static-class-names-order": "off",
145
+ ...stylistic ? {
146
+ "vue/array-bracket-spacing": ["error", "never"],
147
+ "vue/arrow-spacing": ["error", {
148
+ after: true,
149
+ before: true
150
+ }],
151
+ "vue/block-spacing": ["error", "always"],
152
+ "vue/block-tag-newline": ["error", {
153
+ multiline: "always",
154
+ singleline: "always"
155
+ }],
156
+ "vue/brace-style": [
157
+ "error",
158
+ "1tbs",
159
+ { allowSingleLine: true }
160
+ ],
161
+ "vue/comma-dangle": ["error", "always-multiline"],
162
+ "vue/comma-spacing": ["error", {
163
+ after: true,
164
+ before: false
165
+ }],
166
+ "vue/comma-style": ["error", "last"],
167
+ "vue/html-comment-content-spacing": [
168
+ "error",
169
+ "always",
170
+ { exceptions: ["-"] }
171
+ ],
172
+ "vue/key-spacing": ["error", {
173
+ afterColon: true,
174
+ beforeColon: false
175
+ }],
176
+ "vue/keyword-spacing": ["error", {
177
+ after: true,
178
+ before: true
179
+ }],
180
+ "vue/object-curly-newline": "off",
181
+ "vue/object-curly-spacing": ["error", "always"],
182
+ "vue/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
183
+ "vue/operator-linebreak": ["error", "before"],
184
+ "vue/padding-line-between-blocks": ["error", "always"],
185
+ "vue/quote-props": ["error", "consistent-as-needed"],
186
+ "vue/space-in-parens": ["error", "never"],
187
+ "vue/template-curly-spacing": "error"
188
+ } : {},
189
+ "antfu/no-top-level-await": "off",
190
+ "n/prefer-global/process": "off",
191
+ "@typescript-eslint/explicit-function-return-type": "off",
192
+ "@typescript-eslint/naming-convention": "off",
193
+ "@stylistic/max-len": "off",
194
+ ...overrides
195
+ }
196
+ },
197
+ {
198
+ files: [`**/composables/${GLOB_SRC}`],
199
+ name: "eienjs/vue/composables-disables",
200
+ rules: { "@typescript-eslint/explicit-module-boundary-types": "off" }
201
+ }
202
+ ];
203
+ }
204
+
205
+ //#endregion
206
+ export { vue };
@@ -0,0 +1,6 @@
1
+ import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
2
+
3
+ //#region src/configs/yaml.d.ts
4
+ declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
5
+ //#endregion
6
+ export { yaml };
@@ -0,0 +1,83 @@
1
+ import { GLOB_YAML } from "../globs.js";
2
+ import { interopDefault } from "../utils.js";
3
+
4
+ //#region src/configs/yaml.ts
5
+ async function yaml(options = {}) {
6
+ const { files = [GLOB_YAML], overrides = {}, stylistic = true } = options;
7
+ const { indent = 2, quotes = "single" } = typeof stylistic === "boolean" ? {} : stylistic;
8
+ const [pluginYaml, parserYaml] = await Promise.all([interopDefault(import("eslint-plugin-yml")), interopDefault(import("yaml-eslint-parser"))]);
9
+ return [
10
+ {
11
+ name: "eienjs/yaml/setup",
12
+ plugins: { yaml: pluginYaml }
13
+ },
14
+ {
15
+ files,
16
+ languageOptions: { parser: parserYaml },
17
+ name: "eienjs/yaml/rules",
18
+ rules: {
19
+ "@stylistic/spaced-comment": "off",
20
+ "yaml/block-mapping": "error",
21
+ "yaml/block-sequence": "error",
22
+ "yaml/no-empty-key": "error",
23
+ "yaml/no-empty-sequence-entry": "error",
24
+ "yaml/no-irregular-whitespace": "error",
25
+ "yaml/plain-scalar": "error",
26
+ "yaml/vue-custom-block/no-parsing-error": "error",
27
+ ...stylistic ? {
28
+ "yaml/block-mapping-question-indicator-newline": "error",
29
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
30
+ "yaml/flow-mapping-curly-newline": "error",
31
+ "yaml/flow-mapping-curly-spacing": "error",
32
+ "yaml/flow-sequence-bracket-newline": "error",
33
+ "yaml/flow-sequence-bracket-spacing": "error",
34
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
35
+ "yaml/key-spacing": "error",
36
+ "yaml/no-tab-indent": "error",
37
+ "yaml/quotes": ["error", {
38
+ avoidEscape: true,
39
+ prefer: quotes === "backtick" ? "single" : quotes
40
+ }],
41
+ "yaml/spaced-comment": "error"
42
+ } : {},
43
+ ...overrides
44
+ }
45
+ },
46
+ {
47
+ files: ["pnpm-workspace.yaml"],
48
+ name: "eienjs/yaml/pnpm-workspace",
49
+ rules: { "yaml/sort-keys": [
50
+ "error",
51
+ {
52
+ order: [
53
+ "packages",
54
+ "overrides",
55
+ "patchedDependencies",
56
+ "hoistPattern",
57
+ "catalog",
58
+ "catalogs",
59
+ "allowedDeprecatedVersions",
60
+ "allowNonAppliedPatches",
61
+ "configDependencies",
62
+ "ignoredBuiltDependencies",
63
+ "ignoredOptionalDependencies",
64
+ "neverBuiltDependencies",
65
+ "onlyBuiltDependencies",
66
+ "onlyBuiltDependenciesFile",
67
+ "packageExtensions",
68
+ "peerDependencyRules",
69
+ "supportedArchitectures"
70
+ ],
71
+ pathPattern: "^$"
72
+ },
73
+ {
74
+ order: { type: "asc" },
75
+ pathPattern: ".*"
76
+ }
77
+ ] }
78
+ }
79
+ ];
80
+ }
81
+
82
+ //#endregion
83
+ export { yaml };
@@ -0,0 +1,17 @@
1
+ import { ConfigNames, RuleOptions } from "./typegen.js";
2
+ import { OptionsConfig, TypedFlatConfigItem } from "./types.js";
3
+ import { FlatConfigComposer } from "eslint-flat-config-utils";
4
+ import { Linter } from "eslint";
5
+
6
+ //#region src/factory.d.ts
7
+ declare const defaultPluginRenaming: {
8
+ 'import-lite': string;
9
+ vitest: string;
10
+ yml: string;
11
+ };
12
+ declare function eienjs(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
13
+ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
14
+ declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
15
+ declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): Partial<Linter.RulesRecord & RuleOptions>;
16
+ //#endregion
17
+ export { ResolvedOptions, defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions };