@luxass/eslint-config 4.2.5 → 4.2.7

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 (144) hide show
  1. package/README.md +35 -54
  2. package/dist/index.cjs +166 -479
  3. package/dist/index.d.cts +733 -12
  4. package/dist/index.d.ts +733 -12
  5. package/dist/{configs/index.cjs → index.js} +300 -542
  6. package/package.json +51 -86
  7. package/dist/chunk-4YBQZLPS.mjs +0 -68
  8. package/dist/chunk-4YT54JFZ.mjs +0 -48
  9. package/dist/chunk-5NK24IKQ.mjs +0 -26
  10. package/dist/chunk-6T7MXPCT.mjs +0 -17
  11. package/dist/chunk-7ODEIBF5.mjs +0 -144
  12. package/dist/chunk-AQRBQAKE.mjs +0 -48
  13. package/dist/chunk-DAJA5AV3.mjs +0 -29
  14. package/dist/chunk-DCOLHWHC.mjs +0 -269
  15. package/dist/chunk-DVQQVCGF.mjs +0 -45
  16. package/dist/chunk-EHWA727G.mjs +0 -69
  17. package/dist/chunk-FNOIGW47.mjs +0 -104
  18. package/dist/chunk-KOXCJL3C.mjs +0 -109
  19. package/dist/chunk-MMSZW2UW.mjs +0 -92
  20. package/dist/chunk-MT5P5EKH.mjs +0 -207
  21. package/dist/chunk-O2BXTQHK.mjs +0 -117
  22. package/dist/chunk-QDSV5ONX.mjs +0 -93
  23. package/dist/chunk-QMGT2Z63.mjs +0 -57
  24. package/dist/chunk-RVSUTDCE.mjs +0 -57
  25. package/dist/chunk-SPD4DGYN.mjs +0 -274
  26. package/dist/chunk-UITQW3RA.mjs +0 -293
  27. package/dist/chunk-V57HXOSW.mjs +0 -81
  28. package/dist/chunk-WDSV2EFG.mjs +0 -7
  29. package/dist/chunk-WOBGA3K2.mjs +0 -63
  30. package/dist/chunk-WSQOWO67.mjs +0 -16
  31. package/dist/chunk-XBASVDU6.mjs +0 -215
  32. package/dist/chunk-XPKGXA67.mjs +0 -183
  33. package/dist/chunk-YGZJUKJC.mjs +0 -0
  34. package/dist/chunk-YO3IYQ2L.mjs +0 -220
  35. package/dist/configs/astro.cjs +0 -179
  36. package/dist/configs/astro.d.cts +0 -11
  37. package/dist/configs/astro.d.ts +0 -11
  38. package/dist/configs/astro.mjs +0 -8
  39. package/dist/configs/comments.cjs +0 -63
  40. package/dist/configs/comments.d.cts +0 -15
  41. package/dist/configs/comments.d.ts +0 -15
  42. package/dist/configs/comments.mjs +0 -6
  43. package/dist/configs/formatters.cjs +0 -274
  44. package/dist/configs/formatters.d.cts +0 -11
  45. package/dist/configs/formatters.d.ts +0 -11
  46. package/dist/configs/formatters.mjs +0 -9
  47. package/dist/configs/ignores.cjs +0 -96
  48. package/dist/configs/ignores.d.cts +0 -15
  49. package/dist/configs/ignores.d.ts +0 -15
  50. package/dist/configs/ignores.mjs +0 -7
  51. package/dist/configs/imports.cjs +0 -104
  52. package/dist/configs/imports.d.cts +0 -23
  53. package/dist/configs/imports.d.ts +0 -23
  54. package/dist/configs/imports.mjs +0 -7
  55. package/dist/configs/index.d.cts +0 -20
  56. package/dist/configs/index.d.ts +0 -20
  57. package/dist/configs/index.mjs +0 -104
  58. package/dist/configs/javascript.cjs +0 -324
  59. package/dist/configs/javascript.d.cts +0 -11
  60. package/dist/configs/javascript.d.ts +0 -11
  61. package/dist/configs/javascript.mjs +0 -7
  62. package/dist/configs/jsdoc.cjs +0 -85
  63. package/dist/configs/jsdoc.d.cts +0 -27
  64. package/dist/configs/jsdoc.d.ts +0 -27
  65. package/dist/configs/jsdoc.mjs +0 -7
  66. package/dist/configs/jsonc.cjs +0 -155
  67. package/dist/configs/jsonc.d.cts +0 -11
  68. package/dist/configs/jsonc.d.ts +0 -11
  69. package/dist/configs/jsonc.mjs +0 -8
  70. package/dist/configs/markdown.cjs +0 -164
  71. package/dist/configs/markdown.d.cts +0 -35
  72. package/dist/configs/markdown.d.ts +0 -35
  73. package/dist/configs/markdown.mjs +0 -8
  74. package/dist/configs/nextjs.cjs +0 -180
  75. package/dist/configs/nextjs.d.cts +0 -11
  76. package/dist/configs/nextjs.d.ts +0 -11
  77. package/dist/configs/nextjs.mjs +0 -8
  78. package/dist/configs/node.cjs +0 -60
  79. package/dist/configs/node.d.cts +0 -15
  80. package/dist/configs/node.d.ts +0 -15
  81. package/dist/configs/node.mjs +0 -6
  82. package/dist/configs/perfectionist.cjs +0 -51
  83. package/dist/configs/perfectionist.d.cts +0 -20
  84. package/dist/configs/perfectionist.d.ts +0 -20
  85. package/dist/configs/perfectionist.mjs +0 -6
  86. package/dist/configs/react.cjs +0 -379
  87. package/dist/configs/react.d.cts +0 -11
  88. package/dist/configs/react.d.ts +0 -11
  89. package/dist/configs/react.mjs +0 -8
  90. package/dist/configs/solid.cjs +0 -360
  91. package/dist/configs/solid.d.cts +0 -11
  92. package/dist/configs/solid.d.ts +0 -11
  93. package/dist/configs/solid.mjs +0 -8
  94. package/dist/configs/sort.cjs +0 -240
  95. package/dist/configs/sort.d.cts +0 -26
  96. package/dist/configs/sort.d.ts +0 -26
  97. package/dist/configs/sort.mjs +0 -8
  98. package/dist/configs/stylistic.cjs +0 -98
  99. package/dist/configs/stylistic.d.cts +0 -11
  100. package/dist/configs/stylistic.d.ts +0 -11
  101. package/dist/configs/stylistic.mjs +0 -9
  102. package/dist/configs/tailwindcss.cjs +0 -148
  103. package/dist/configs/tailwindcss.d.cts +0 -11
  104. package/dist/configs/tailwindcss.d.ts +0 -11
  105. package/dist/configs/tailwindcss.mjs +0 -8
  106. package/dist/configs/test.cjs +0 -206
  107. package/dist/configs/test.d.cts +0 -11
  108. package/dist/configs/test.d.ts +0 -11
  109. package/dist/configs/test.mjs +0 -9
  110. package/dist/configs/toml.cjs +0 -131
  111. package/dist/configs/toml.d.cts +0 -11
  112. package/dist/configs/toml.d.ts +0 -11
  113. package/dist/configs/toml.mjs +0 -8
  114. package/dist/configs/typescript.cjs +0 -291
  115. package/dist/configs/typescript.d.cts +0 -11
  116. package/dist/configs/typescript.d.ts +0 -11
  117. package/dist/configs/typescript.mjs +0 -8
  118. package/dist/configs/unicorn.cjs +0 -91
  119. package/dist/configs/unicorn.d.cts +0 -15
  120. package/dist/configs/unicorn.d.ts +0 -15
  121. package/dist/configs/unicorn.mjs +0 -6
  122. package/dist/configs/unocss.cjs +0 -133
  123. package/dist/configs/unocss.d.cts +0 -11
  124. package/dist/configs/unocss.d.ts +0 -11
  125. package/dist/configs/unocss.mjs +0 -8
  126. package/dist/configs/vue.cjs +0 -293
  127. package/dist/configs/vue.d.cts +0 -11
  128. package/dist/configs/vue.d.ts +0 -11
  129. package/dist/configs/vue.mjs +0 -8
  130. package/dist/configs/yaml.cjs +0 -143
  131. package/dist/configs/yaml.d.cts +0 -11
  132. package/dist/configs/yaml.d.ts +0 -11
  133. package/dist/configs/yaml.mjs +0 -8
  134. package/dist/custom-rules/utils.cjs +0 -31
  135. package/dist/custom-rules/utils.d.cts +0 -6
  136. package/dist/custom-rules/utils.d.ts +0 -6
  137. package/dist/custom-rules/utils.mjs +0 -6
  138. package/dist/globs.cjs +0 -158
  139. package/dist/globs.d.cts +0 -28
  140. package/dist/globs.d.ts +0 -28
  141. package/dist/globs.mjs +0 -56
  142. package/dist/index.mjs +0 -284
  143. package/dist/types-HqEzZfQU.d.cts +0 -668
  144. package/dist/types-HqEzZfQU.d.ts +0 -668
@@ -1,207 +0,0 @@
1
- import {
2
- ensure,
3
- interop
4
- } from "./chunk-4YBQZLPS.mjs";
5
- import {
6
- GLOB_VUE
7
- } from "./chunk-KOXCJL3C.mjs";
8
-
9
- // src/configs/vue.ts
10
- import { mergeProcessors } from "eslint-merge-processors";
11
- async function vue(options = {}) {
12
- const {
13
- a11y = false,
14
- files = [GLOB_VUE],
15
- overrides = {},
16
- stylistic = true
17
- } = options;
18
- if (a11y) {
19
- await ensure(["eslint-plugin-vuejs-accessibility"]);
20
- }
21
- const [
22
- pluginVue,
23
- parserVue,
24
- processorVueBlocks,
25
- pluginA11y
26
- ] = await Promise.all([
27
- interop(import("eslint-plugin-vue")),
28
- interop(import("vue-eslint-parser")),
29
- interop(import("eslint-processor-vue-blocks")),
30
- ...a11y ? [interop(import("eslint-plugin-vuejs-accessibility"))] : []
31
- ]);
32
- const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
33
- const {
34
- indent = 2
35
- } = typeof stylistic === "boolean" ? {} : stylistic;
36
- return [
37
- {
38
- name: "luxass:vue:setup",
39
- plugins: {
40
- vue: pluginVue,
41
- ...a11y ? { "vue-a11y": pluginA11y } : {}
42
- }
43
- },
44
- {
45
- name: "luxass:vue:rules",
46
- files,
47
- languageOptions: {
48
- parser: parserVue,
49
- parserOptions: {
50
- ecmaFeatures: {
51
- jsx: true
52
- },
53
- extraFileExtensions: [".vue"],
54
- parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null,
55
- sourceType: "module"
56
- }
57
- },
58
- processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([
59
- pluginVue.processors[".vue"],
60
- processorVueBlocks({
61
- ...sfcBlocks,
62
- blocks: {
63
- styles: true,
64
- ...sfcBlocks.blocks
65
- }
66
- })
67
- ]),
68
- rules: {
69
- ...pluginVue.configs.base.rules,
70
- ...pluginVue.configs["vue3-essential"].rules,
71
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
72
- ...pluginVue.configs["vue3-recommended"].rules,
73
- "node/prefer-global/process": "off",
74
- "vue/block-order": [
75
- "error",
76
- {
77
- order: ["script", "template", "style"]
78
- }
79
- ],
80
- "vue/component-name-in-template-casing": ["error", "PascalCase"],
81
- "vue/component-options-name-casing": ["error", "PascalCase"],
82
- // this is deprecated
83
- "vue/component-tags-order": "off",
84
- "vue/custom-event-name-casing": ["error", "camelCase"],
85
- "vue/define-macros-order": [
86
- "error",
87
- {
88
- order: [
89
- "defineOptions",
90
- "defineProps",
91
- "defineEmits",
92
- "defineSlots"
93
- ]
94
- }
95
- ],
96
- "vue/dot-location": ["error", "property"],
97
- "vue/dot-notation": ["error", { allowKeywords: true }],
98
- "vue/eqeqeq": ["error", "smart"],
99
- "vue/html-indent": ["error", indent],
100
- "vue/html-quotes": ["error", "double"],
101
- "vue/max-attributes-per-line": "off",
102
- "vue/multi-word-component-names": "off",
103
- "vue/no-dupe-keys": "off",
104
- "vue/no-empty-pattern": "error",
105
- "vue/no-irregular-whitespace": "error",
106
- "vue/no-loss-of-precision": "error",
107
- "vue/no-restricted-syntax": [
108
- "error",
109
- "DebuggerStatement",
110
- "LabeledStatement",
111
- "WithStatement"
112
- ],
113
- "vue/no-restricted-v-bind": ["error", "/^v-/"],
114
- "vue/no-setup-props-reactivity-loss": "off",
115
- "vue/no-sparse-arrays": "error",
116
- "vue/no-unused-refs": "error",
117
- "vue/no-useless-v-bind": "error",
118
- "vue/no-v-html": "off",
119
- "vue/object-shorthand": [
120
- "error",
121
- "always",
122
- {
123
- avoidQuotes: true,
124
- ignoreConstructors: false
125
- }
126
- ],
127
- "vue/prefer-separate-static-class": "error",
128
- "vue/prefer-template": "error",
129
- "vue/prop-name-casing": ["error", "camelCase"],
130
- "vue/require-default-prop": "off",
131
- "vue/require-prop-types": "off",
132
- "vue/space-infix-ops": "error",
133
- "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
134
- ...stylistic ? {
135
- "vue/array-bracket-spacing": ["error", "never"],
136
- "vue/arrow-spacing": ["error", { after: true, before: true }],
137
- "vue/block-spacing": ["error", "always"],
138
- "vue/block-tag-newline": [
139
- "error",
140
- {
141
- multiline: "always",
142
- singleline: "always"
143
- }
144
- ],
145
- "vue/brace-style": [
146
- "error",
147
- "stroustrup",
148
- { allowSingleLine: true }
149
- ],
150
- "vue/comma-dangle": ["error", "always-multiline"],
151
- "vue/comma-spacing": ["error", { after: true, before: false }],
152
- "vue/comma-style": ["error", "last"],
153
- "vue/html-comment-content-spacing": [
154
- "error",
155
- "always",
156
- {
157
- exceptions: ["-"]
158
- }
159
- ],
160
- "vue/key-spacing": [
161
- "error",
162
- { afterColon: true, beforeColon: false }
163
- ],
164
- "vue/keyword-spacing": ["error", { after: true, before: true }],
165
- "vue/object-curly-newline": "off",
166
- "vue/object-curly-spacing": ["error", "always"],
167
- "vue/object-property-newline": [
168
- "error",
169
- { allowMultiplePropertiesPerLine: true }
170
- ],
171
- "vue/operator-linebreak": ["error", "before"],
172
- "vue/padding-line-between-blocks": ["error", "always"],
173
- "vue/quote-props": ["error", "consistent-as-needed"],
174
- "vue/space-in-parens": ["error", "never"],
175
- "vue/template-curly-spacing": "error"
176
- } : {},
177
- ...a11y ? {
178
- "vue-a11y/alt-text": "error",
179
- "vue-a11y/anchor-has-content": "error",
180
- "vue-a11y/aria-props": "error",
181
- "vue-a11y/aria-role": "error",
182
- "vue-a11y/aria-unsupported-elements": "error",
183
- "vue-a11y/click-events-have-key-events": "error",
184
- "vue-a11y/form-control-has-label": "error",
185
- "vue-a11y/heading-has-content": "error",
186
- "vue-a11y/iframe-has-title": "error",
187
- "vue-a11y/interactive-supports-focus": "error",
188
- "vue-a11y/label-has-for": "error",
189
- "vue-a11y/media-has-caption": "error",
190
- "vue-a11y/mouse-events-have-key-events": "error",
191
- "vue-a11y/no-access-key": "error",
192
- "vue-a11y/no-autofocus": "error",
193
- "vue-a11y/no-distracting-elements": "error",
194
- "vue-a11y/no-redundant-roles": "error",
195
- "vue-a11y/no-static-element-interactions": "error",
196
- "vue-a11y/role-has-required-aria-props": "error",
197
- "vue-a11y/tabindex-no-positive": "error"
198
- } : {},
199
- ...overrides
200
- }
201
- }
202
- ];
203
- }
204
-
205
- export {
206
- vue
207
- };
@@ -1,117 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4YBQZLPS.mjs";
4
- import {
5
- GLOB_ASTRO
6
- } from "./chunk-KOXCJL3C.mjs";
7
-
8
- // src/configs/astro.ts
9
- async function astro(options) {
10
- const {
11
- a11y = false,
12
- files = [GLOB_ASTRO],
13
- overrides = {},
14
- typescript = true
15
- } = options;
16
- const [
17
- pluginAstro,
18
- parserAstro,
19
- pluginA11y
20
- ] = await Promise.all([
21
- interop(import("eslint-plugin-astro")),
22
- interop(import("astro-eslint-parser")),
23
- ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
24
- ]);
25
- return [
26
- {
27
- name: "luxass:astro:setup",
28
- plugins: {
29
- astro: pluginAstro,
30
- ...a11y ? { "jsx-a11y": pluginA11y } : {}
31
- }
32
- },
33
- {
34
- name: "luxass:astro:rules",
35
- files,
36
- languageOptions: {
37
- globals: {
38
- "astro/astro": true,
39
- "es2020": true,
40
- "node": true
41
- },
42
- parser: parserAstro,
43
- parserOptions: {
44
- extraFileExtensions: [".astro"],
45
- parser: typescript ? await interop(import("@typescript-eslint/parser")) : null,
46
- sourceType: "module"
47
- }
48
- },
49
- rules: {
50
- // Disallow conflicting set directives and child contents
51
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
52
- "astro/no-conflict-set-directives": "error",
53
- // Disallow using deprecated Astro.canonicalURL
54
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-canonicalurl/
55
- "astro/no-deprecated-astro-canonicalurl": "error",
56
- // Disallow using deprecated Astro.fetchContent()
57
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-fetchcontent/
58
- "astro/no-deprecated-astro-fetchcontent": "error",
59
- // Disallow using deprecated Astro.resolve()
60
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-resolve/
61
- "astro/no-deprecated-astro-resolve": "error",
62
- // Disallow using deprecated getEntryBySlug()
63
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
64
- "astro/no-deprecated-getentrybyslug": "error",
65
- // Disallow unused define:vars={...} in style tag
66
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-define-vars-in-style/
67
- "astro/no-unused-define-vars-in-style": "error",
68
- // Disallow warnings when compiling
69
- // https://ota-meshi.github.io/eslint-plugin-astro/rules/valid-compile/
70
- "astro/valid-compile": "error",
71
- "style/jsx-closing-tag-location": "off",
72
- "style/jsx-indent": "off",
73
- "style/jsx-one-expression-per-line": "off",
74
- "style/multiline-ternary": ["error", "never"],
75
- ...overrides
76
- }
77
- },
78
- {
79
- name: "luxass:astro:scripts-js",
80
- files: [
81
- "**/*.astro/*.js",
82
- "*.astro/*.js"
83
- ],
84
- languageOptions: {
85
- globals: {
86
- browser: true,
87
- es2020: true
88
- },
89
- parserOptions: {
90
- sourceType: "module"
91
- }
92
- }
93
- },
94
- {
95
- name: "luxass:astro:scripts-ts",
96
- files: [
97
- "**/*.astro/*.ts",
98
- "*.astro/*.ts"
99
- ],
100
- languageOptions: {
101
- globals: {
102
- browser: true,
103
- es2020: true
104
- },
105
- parser: typescript ? await interop(import("@typescript-eslint/parser")) : null,
106
- parserOptions: {
107
- project: null,
108
- sourceType: "module"
109
- }
110
- }
111
- }
112
- ];
113
- }
114
-
115
- export {
116
- astro
117
- };
@@ -1,93 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4YBQZLPS.mjs";
4
- import {
5
- GLOB_JSON,
6
- GLOB_JSON5,
7
- GLOB_JSONC
8
- } from "./chunk-KOXCJL3C.mjs";
9
-
10
- // src/configs/jsonc.ts
11
- async function jsonc(options = {}) {
12
- const {
13
- files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
14
- overrides = {},
15
- stylistic = true
16
- } = options;
17
- const [
18
- pluginJsonc,
19
- parserJsonc
20
- ] = await Promise.all([
21
- interop(import("eslint-plugin-jsonc")),
22
- interop(import("jsonc-eslint-parser"))
23
- ]);
24
- return [
25
- {
26
- name: "luxass:jsonc:setup",
27
- plugins: {
28
- jsonc: pluginJsonc
29
- }
30
- },
31
- {
32
- name: "luxass:jsonc:rules",
33
- files,
34
- languageOptions: {
35
- parser: parserJsonc
36
- },
37
- rules: {
38
- "jsonc/no-bigint-literals": "error",
39
- "jsonc/no-binary-expression": "error",
40
- "jsonc/no-binary-numeric-literals": "error",
41
- "jsonc/no-dupe-keys": "error",
42
- "jsonc/no-escape-sequence-in-identifier": "error",
43
- "jsonc/no-floating-decimal": "error",
44
- "jsonc/no-hexadecimal-numeric-literals": "error",
45
- "jsonc/no-infinity": "error",
46
- "jsonc/no-multi-str": "error",
47
- "jsonc/no-nan": "error",
48
- "jsonc/no-number-props": "error",
49
- "jsonc/no-numeric-separators": "error",
50
- "jsonc/no-octal": "error",
51
- "jsonc/no-octal-escape": "error",
52
- "jsonc/no-octal-numeric-literals": "error",
53
- "jsonc/no-parenthesized": "error",
54
- "jsonc/no-plus-sign": "error",
55
- "jsonc/no-regexp-literals": "error",
56
- "jsonc/no-sparse-arrays": "error",
57
- "jsonc/no-template-literals": "error",
58
- "jsonc/no-undefined-value": "error",
59
- "jsonc/no-unicode-codepoint-escapes": "error",
60
- "jsonc/no-useless-escape": "error",
61
- "jsonc/space-unary-ops": "error",
62
- "jsonc/valid-json-number": "error",
63
- "jsonc/vue-custom-block/no-parsing-error": "error",
64
- ...stylistic ? {
65
- "jsonc/array-bracket-spacing": ["error", "never"],
66
- "jsonc/comma-dangle": ["error", "never"],
67
- "jsonc/comma-style": ["error", "last"],
68
- "jsonc/indent": ["error", 2],
69
- "jsonc/key-spacing": [
70
- "error",
71
- { afterColon: true, beforeColon: false }
72
- ],
73
- "jsonc/object-curly-newline": [
74
- "error",
75
- { consistent: true, multiline: true }
76
- ],
77
- "jsonc/object-curly-spacing": ["error", "always"],
78
- "jsonc/object-property-newline": [
79
- "error",
80
- { allowMultiplePropertiesPerLine: true }
81
- ],
82
- "jsonc/quote-props": "error",
83
- "jsonc/quotes": "error"
84
- } : {},
85
- ...overrides
86
- }
87
- }
88
- ];
89
- }
90
-
91
- export {
92
- jsonc
93
- };
@@ -1,57 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4YBQZLPS.mjs";
4
-
5
- // src/configs/stylistic.ts
6
- import pluginAntfu from "eslint-plugin-antfu";
7
- var StylisticConfigDefaults = {
8
- indent: 2,
9
- jsx: true,
10
- quotes: "double",
11
- semi: false
12
- };
13
- async function stylistic(options = {}) {
14
- const {
15
- indent,
16
- jsx,
17
- overrides = {},
18
- quotes,
19
- semi
20
- } = {
21
- ...StylisticConfigDefaults,
22
- ...options
23
- };
24
- const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
25
- const config = pluginStylistic.configs.customize({
26
- flat: true,
27
- indent,
28
- jsx,
29
- pluginName: "style",
30
- quotes,
31
- semi
32
- });
33
- return [
34
- {
35
- name: "luxass:stylistic",
36
- plugins: {
37
- antfu: pluginAntfu,
38
- style: pluginStylistic
39
- },
40
- rules: {
41
- ...config.rules,
42
- "antfu/consistent-list-newline": "error",
43
- "antfu/if-newline": "off",
44
- "antfu/top-level-function": "error",
45
- "curly": ["error", "multi-line", "consistent"],
46
- "style/arrow-parens": ["error", "always", { requireForBlockBody: true }],
47
- "style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
48
- ...overrides
49
- }
50
- }
51
- ];
52
- }
53
-
54
- export {
55
- StylisticConfigDefaults,
56
- stylistic
57
- };
@@ -1,57 +0,0 @@
1
- // src/configs/unicorn.ts
2
- import pluginUnicorn from "eslint-plugin-unicorn";
3
- function unicorn() {
4
- return [
5
- {
6
- name: "luxass:unicorn",
7
- plugins: {
8
- unicorn: pluginUnicorn
9
- },
10
- rules: {
11
- // Pass error message when throwing errors
12
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
13
- "unicorn/error-message": "error",
14
- // Uppercase regex escapes
15
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
16
- "unicorn/escape-case": "error",
17
- // Array.isArray instead of instanceof
18
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
19
- "unicorn/no-instanceof-array": "error",
20
- // Ban `new Array` as `Array` constructor's params are ambiguous
21
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
22
- "unicorn/no-new-array": "error",
23
- // Prevent deprecated `new Buffer()`
24
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
25
- "unicorn/no-new-buffer": "error",
26
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
27
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
28
- "unicorn/number-literal-case": "error",
29
- // textContent instead of innerText
30
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
31
- "unicorn/prefer-dom-node-text-content": "error",
32
- // includes over indexOf when checking for existence
33
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
34
- "unicorn/prefer-includes": "error",
35
- // Prefer using the node: protocol
36
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
37
- "unicorn/prefer-node-protocol": "error",
38
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
39
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
40
- "unicorn/prefer-number-properties": "error",
41
- // String methods startsWith/endsWith instead of more complicated stuff
42
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
43
- "unicorn/prefer-string-starts-ends-with": "error",
44
- // Enforce throwing type error when throwing error while checking typeof
45
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
46
- "unicorn/prefer-type-error": "error",
47
- // Use new when throwing error
48
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
49
- "unicorn/throw-new-error": "error"
50
- }
51
- }
52
- ];
53
- }
54
-
55
- export {
56
- unicorn
57
- };