@saasmakers/eslint 0.2.5 → 0.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.
- package/dist/chunks/formatters.cjs +248 -0
- package/dist/chunks/formatters.mjs +246 -0
- package/dist/chunks/import.cjs +53 -0
- package/dist/chunks/import.mjs +51 -0
- package/dist/chunks/index.cjs +120 -0
- package/dist/chunks/index.mjs +101 -0
- package/dist/chunks/index2.cjs +880 -0
- package/dist/chunks/index2.mjs +868 -0
- package/dist/chunks/index3.cjs +982 -0
- package/dist/chunks/index3.mjs +979 -0
- package/dist/chunks/index4.cjs +12099 -0
- package/dist/chunks/index4.mjs +12077 -0
- package/dist/chunks/jsdoc.cjs +38398 -0
- package/dist/chunks/jsdoc.mjs +38391 -0
- package/dist/chunks/regexp.cjs +18518 -0
- package/dist/chunks/regexp.mjs +18511 -0
- package/dist/chunks/stylistic.cjs +23935 -0
- package/dist/chunks/stylistic.mjs +23932 -0
- package/dist/chunks/typescript.cjs +56168 -0
- package/dist/chunks/typescript.mjs +56154 -0
- package/dist/chunks/unicorn.cjs +82775 -0
- package/dist/chunks/unicorn.mjs +82764 -0
- package/dist/chunks/vue.cjs +96233 -0
- package/dist/chunks/vue.mjs +96220 -0
- package/dist/eslint.config.cjs +19 -10874
- package/dist/eslint.config.d.cts +3900 -18
- package/dist/eslint.config.d.mts +3900 -18
- package/dist/eslint.config.d.ts +3900 -18
- package/dist/eslint.config.mjs +18 -10852
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +1 -1
- package/dist/shared/eslint.05nu4VbT.mjs +9 -0
- package/dist/shared/eslint.07qTxm9w.mjs +3352 -0
- package/dist/shared/eslint.6MAvpL4q.cjs +2141 -0
- package/dist/shared/{eslint.CohBuu1-.mjs → eslint.B3ywQ3NK.mjs} +157 -331
- package/dist/shared/eslint.BGpVg2tt.cjs +13 -0
- package/dist/shared/eslint.BL4sYiVQ.cjs +820 -0
- package/dist/shared/eslint.BOOP2x9L.cjs +67 -0
- package/dist/shared/eslint.Bf7aat-e.mjs +10 -0
- package/dist/shared/eslint.Bh1W2iVQ.cjs +37181 -0
- package/dist/shared/eslint.Bl69eiyD.cjs +7073 -0
- package/dist/shared/eslint.BtkqW7nC.mjs +818 -0
- package/dist/shared/eslint.C12_M0Cw.cjs +9 -0
- package/dist/shared/eslint.CMfxPSSy.cjs +14 -0
- package/dist/shared/eslint.COweQ1RR.mjs +5 -0
- package/dist/shared/eslint.CUi9znUC.mjs +13 -0
- package/dist/shared/eslint.Cg6Ty7p7.mjs +2699 -0
- package/dist/shared/eslint.CxAZpd0w.cjs +3365 -0
- package/dist/shared/eslint.CyJA7jO6.cjs +3813 -0
- package/dist/shared/eslint.DDD2xc4l.cjs +25 -0
- package/dist/shared/eslint.DI7QBrVD.mjs +6 -0
- package/dist/shared/eslint.DUamuDzp.cjs +7 -0
- package/dist/shared/eslint.DV_fpPxQ.mjs +3805 -0
- package/dist/shared/{eslint.DhFjwkxh.cjs → eslint.Dhg0jKDi.cjs} +167 -330
- package/dist/shared/eslint.Difk5awg.mjs +2139 -0
- package/dist/shared/eslint.Dlgr3LGM.mjs +7070 -0
- package/dist/shared/eslint.DoYGbUIG.cjs +2724 -0
- package/dist/shared/eslint.Dprsk9zl.mjs +65 -0
- package/dist/shared/eslint.DuJbNenz.mjs +37140 -0
- package/dist/shared/eslint.MfgVmFE7.cjs +3054 -0
- package/dist/shared/eslint.W7RM7aEw.mjs +3052 -0
- package/package.json +2 -1
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const eslint_config = require('../shared/eslint.Bh1W2iVQ.cjs');
|
|
4
|
+
const eslintConfig_CUi9znUC = require('../shared/eslint.DDD2xc4l.cjs');
|
|
5
|
+
require('node:process');
|
|
6
|
+
require('@antfu/eslint-config');
|
|
7
|
+
require('node:fs');
|
|
8
|
+
require('node:path');
|
|
9
|
+
require('node:fs/promises');
|
|
10
|
+
require('node:url');
|
|
11
|
+
require('node:module');
|
|
12
|
+
require('node:assert');
|
|
13
|
+
require('node:v8');
|
|
14
|
+
require('node:util');
|
|
15
|
+
require('../shared/eslint.Dhg0jKDi.cjs');
|
|
16
|
+
require('eslint');
|
|
17
|
+
require('eslint/use-at-your-own-risk');
|
|
18
|
+
require('@saasmakers/eslint');
|
|
19
|
+
require('@vitest/eslint-plugin');
|
|
20
|
+
require('eslint-plugin-package-json');
|
|
21
|
+
require('eslint-plugin-storybook');
|
|
22
|
+
require('eslint-plugin-turbo');
|
|
23
|
+
require('eslint-plugin-zod');
|
|
24
|
+
|
|
25
|
+
function mergePrettierOptions(options, overrides = {}) {
|
|
26
|
+
return {
|
|
27
|
+
...options,
|
|
28
|
+
...overrides,
|
|
29
|
+
plugins: [
|
|
30
|
+
...overrides.plugins || [],
|
|
31
|
+
...options.plugins || []
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function formatters(options = {}, stylistic) {
|
|
36
|
+
if (!options)
|
|
37
|
+
return [];
|
|
38
|
+
if (options === true) {
|
|
39
|
+
const isPrettierPluginXmlInScope = eslint_config.isPackageExists("@prettier/plugin-xml");
|
|
40
|
+
options = {
|
|
41
|
+
css: true,
|
|
42
|
+
graphql: true,
|
|
43
|
+
html: true,
|
|
44
|
+
// Markdown is disabled by default as many Nuxt projects use MDC with @nuxt/content,
|
|
45
|
+
// where Prettier doesn't fully understand.
|
|
46
|
+
markdown: false,
|
|
47
|
+
svg: isPrettierPluginXmlInScope,
|
|
48
|
+
xml: isPrettierPluginXmlInScope
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
await eslint_config.ensurePackages([
|
|
52
|
+
"eslint-plugin-format",
|
|
53
|
+
options.xml || options.svg ? "@prettier/plugin-xml" : void 0
|
|
54
|
+
]);
|
|
55
|
+
const {
|
|
56
|
+
indent,
|
|
57
|
+
quotes,
|
|
58
|
+
semi
|
|
59
|
+
} = {
|
|
60
|
+
indent: 2,
|
|
61
|
+
quotes: "single",
|
|
62
|
+
semi: false,
|
|
63
|
+
...stylistic
|
|
64
|
+
};
|
|
65
|
+
const prettierOptions = Object.assign(
|
|
66
|
+
{
|
|
67
|
+
endOfLine: "auto",
|
|
68
|
+
printWidth: 120,
|
|
69
|
+
semi,
|
|
70
|
+
singleQuote: quotes === "single",
|
|
71
|
+
tabWidth: typeof indent === "number" ? indent : 2,
|
|
72
|
+
trailingComma: "all",
|
|
73
|
+
useTabs: indent === "tab"
|
|
74
|
+
},
|
|
75
|
+
options.prettierOptions || {}
|
|
76
|
+
);
|
|
77
|
+
const prettierXmlOptions = {
|
|
78
|
+
xmlQuoteAttributes: "double",
|
|
79
|
+
xmlSelfClosingSpace: true,
|
|
80
|
+
xmlSortAttributesByKey: false,
|
|
81
|
+
xmlWhitespaceSensitivity: "ignore"
|
|
82
|
+
};
|
|
83
|
+
const dprintOptions = Object.assign(
|
|
84
|
+
{
|
|
85
|
+
indentWidth: typeof indent === "number" ? indent : 2,
|
|
86
|
+
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
87
|
+
useTabs: indent === "tab"
|
|
88
|
+
},
|
|
89
|
+
options.dprintOptions || {}
|
|
90
|
+
);
|
|
91
|
+
const pluginFormat = await eslint_config.interopDefault(import('eslint-plugin-format'));
|
|
92
|
+
const configs = [
|
|
93
|
+
{
|
|
94
|
+
name: "nuxt/formatter/setup",
|
|
95
|
+
plugins: {
|
|
96
|
+
format: pluginFormat
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
if (options.css) {
|
|
101
|
+
configs.push(
|
|
102
|
+
{
|
|
103
|
+
files: [eslintConfig_CUi9znUC.GLOB_CSS, eslintConfig_CUi9znUC.GLOB_POSTCSS],
|
|
104
|
+
languageOptions: {
|
|
105
|
+
parser: eslint_config.parserPlain
|
|
106
|
+
},
|
|
107
|
+
name: "nuxt/formatter/css",
|
|
108
|
+
rules: {
|
|
109
|
+
"format/prettier": [
|
|
110
|
+
"error",
|
|
111
|
+
mergePrettierOptions(prettierOptions, {
|
|
112
|
+
parser: "css"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
files: [eslintConfig_CUi9znUC.GLOB_SCSS],
|
|
119
|
+
languageOptions: {
|
|
120
|
+
parser: eslint_config.parserPlain
|
|
121
|
+
},
|
|
122
|
+
name: "nuxt/formatter/scss",
|
|
123
|
+
rules: {
|
|
124
|
+
"format/prettier": [
|
|
125
|
+
"error",
|
|
126
|
+
mergePrettierOptions(prettierOptions, {
|
|
127
|
+
parser: "scss"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
files: [eslintConfig_CUi9znUC.GLOB_LESS],
|
|
134
|
+
languageOptions: {
|
|
135
|
+
parser: eslint_config.parserPlain
|
|
136
|
+
},
|
|
137
|
+
name: "nuxt/formatter/less",
|
|
138
|
+
rules: {
|
|
139
|
+
"format/prettier": [
|
|
140
|
+
"error",
|
|
141
|
+
mergePrettierOptions(prettierOptions, {
|
|
142
|
+
parser: "less"
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
if (options.html) {
|
|
150
|
+
configs.push({
|
|
151
|
+
files: [eslintConfig_CUi9znUC.GLOB_HTML],
|
|
152
|
+
languageOptions: {
|
|
153
|
+
parser: eslint_config.parserPlain
|
|
154
|
+
},
|
|
155
|
+
name: "nuxt/formatter/html",
|
|
156
|
+
rules: {
|
|
157
|
+
"format/prettier": [
|
|
158
|
+
"error",
|
|
159
|
+
mergePrettierOptions(prettierOptions, {
|
|
160
|
+
parser: "html"
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (options.xml) {
|
|
167
|
+
configs.push({
|
|
168
|
+
files: [eslintConfig_CUi9znUC.GLOB_XML],
|
|
169
|
+
languageOptions: {
|
|
170
|
+
parser: eslint_config.parserPlain
|
|
171
|
+
},
|
|
172
|
+
name: "nuxt/formatter/xml",
|
|
173
|
+
rules: {
|
|
174
|
+
"format/prettier": [
|
|
175
|
+
"error",
|
|
176
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
177
|
+
parser: "xml",
|
|
178
|
+
plugins: [
|
|
179
|
+
"@prettier/plugin-xml"
|
|
180
|
+
]
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (options.svg) {
|
|
187
|
+
configs.push({
|
|
188
|
+
files: [eslintConfig_CUi9znUC.GLOB_SVG],
|
|
189
|
+
languageOptions: {
|
|
190
|
+
parser: eslint_config.parserPlain
|
|
191
|
+
},
|
|
192
|
+
name: "nuxt/formatter/svg",
|
|
193
|
+
rules: {
|
|
194
|
+
"format/prettier": [
|
|
195
|
+
"error",
|
|
196
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
197
|
+
parser: "xml",
|
|
198
|
+
plugins: [
|
|
199
|
+
"@prettier/plugin-xml"
|
|
200
|
+
]
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (options.markdown) {
|
|
207
|
+
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
208
|
+
configs.push({
|
|
209
|
+
files: [eslintConfig_CUi9znUC.GLOB_MARKDOWN],
|
|
210
|
+
languageOptions: {
|
|
211
|
+
parser: eslint_config.parserPlain
|
|
212
|
+
},
|
|
213
|
+
name: "nuxt/formatter/markdown",
|
|
214
|
+
rules: {
|
|
215
|
+
[`format/${formater}`]: [
|
|
216
|
+
"error",
|
|
217
|
+
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
218
|
+
embeddedLanguageFormatting: "off",
|
|
219
|
+
parser: "markdown"
|
|
220
|
+
}) : {
|
|
221
|
+
...dprintOptions,
|
|
222
|
+
language: "markdown"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (options.graphql) {
|
|
229
|
+
configs.push({
|
|
230
|
+
files: [eslintConfig_CUi9znUC.GLOB_GRAPHQL],
|
|
231
|
+
languageOptions: {
|
|
232
|
+
parser: eslint_config.parserPlain
|
|
233
|
+
},
|
|
234
|
+
name: "nuxt/formatter/graphql",
|
|
235
|
+
rules: {
|
|
236
|
+
"format/prettier": [
|
|
237
|
+
"error",
|
|
238
|
+
mergePrettierOptions(prettierOptions, {
|
|
239
|
+
parser: "graphql"
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
return configs;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
exports.formatters = formatters;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { i as isPackageExists, e as ensurePackages, b as interopDefault, p as parserPlain } from '../shared/eslint.DuJbNenz.mjs';
|
|
2
|
+
import { b as GLOB_CSS, c as GLOB_POSTCSS, d as GLOB_SCSS, e as GLOB_LESS, f as GLOB_HTML, g as GLOB_XML, h as GLOB_SVG, i as GLOB_MARKDOWN, j as GLOB_GRAPHQL } from '../shared/eslint.CUi9znUC.mjs';
|
|
3
|
+
import 'node:process';
|
|
4
|
+
import '@antfu/eslint-config';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'node:fs/promises';
|
|
8
|
+
import 'node:url';
|
|
9
|
+
import 'node:module';
|
|
10
|
+
import 'node:assert';
|
|
11
|
+
import 'node:v8';
|
|
12
|
+
import 'node:util';
|
|
13
|
+
import '../shared/eslint.B3ywQ3NK.mjs';
|
|
14
|
+
import 'eslint';
|
|
15
|
+
import 'eslint/use-at-your-own-risk';
|
|
16
|
+
import '@saasmakers/eslint';
|
|
17
|
+
import '@vitest/eslint-plugin';
|
|
18
|
+
import 'eslint-plugin-package-json';
|
|
19
|
+
import 'eslint-plugin-storybook';
|
|
20
|
+
import 'eslint-plugin-turbo';
|
|
21
|
+
import 'eslint-plugin-zod';
|
|
22
|
+
|
|
23
|
+
function mergePrettierOptions(options, overrides = {}) {
|
|
24
|
+
return {
|
|
25
|
+
...options,
|
|
26
|
+
...overrides,
|
|
27
|
+
plugins: [
|
|
28
|
+
...overrides.plugins || [],
|
|
29
|
+
...options.plugins || []
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function formatters(options = {}, stylistic) {
|
|
34
|
+
if (!options)
|
|
35
|
+
return [];
|
|
36
|
+
if (options === true) {
|
|
37
|
+
const isPrettierPluginXmlInScope = isPackageExists("@prettier/plugin-xml");
|
|
38
|
+
options = {
|
|
39
|
+
css: true,
|
|
40
|
+
graphql: true,
|
|
41
|
+
html: true,
|
|
42
|
+
// Markdown is disabled by default as many Nuxt projects use MDC with @nuxt/content,
|
|
43
|
+
// where Prettier doesn't fully understand.
|
|
44
|
+
markdown: false,
|
|
45
|
+
svg: isPrettierPluginXmlInScope,
|
|
46
|
+
xml: isPrettierPluginXmlInScope
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
await ensurePackages([
|
|
50
|
+
"eslint-plugin-format",
|
|
51
|
+
options.xml || options.svg ? "@prettier/plugin-xml" : void 0
|
|
52
|
+
]);
|
|
53
|
+
const {
|
|
54
|
+
indent,
|
|
55
|
+
quotes,
|
|
56
|
+
semi
|
|
57
|
+
} = {
|
|
58
|
+
indent: 2,
|
|
59
|
+
quotes: "single",
|
|
60
|
+
semi: false,
|
|
61
|
+
...stylistic
|
|
62
|
+
};
|
|
63
|
+
const prettierOptions = Object.assign(
|
|
64
|
+
{
|
|
65
|
+
endOfLine: "auto",
|
|
66
|
+
printWidth: 120,
|
|
67
|
+
semi,
|
|
68
|
+
singleQuote: quotes === "single",
|
|
69
|
+
tabWidth: typeof indent === "number" ? indent : 2,
|
|
70
|
+
trailingComma: "all",
|
|
71
|
+
useTabs: indent === "tab"
|
|
72
|
+
},
|
|
73
|
+
options.prettierOptions || {}
|
|
74
|
+
);
|
|
75
|
+
const prettierXmlOptions = {
|
|
76
|
+
xmlQuoteAttributes: "double",
|
|
77
|
+
xmlSelfClosingSpace: true,
|
|
78
|
+
xmlSortAttributesByKey: false,
|
|
79
|
+
xmlWhitespaceSensitivity: "ignore"
|
|
80
|
+
};
|
|
81
|
+
const dprintOptions = Object.assign(
|
|
82
|
+
{
|
|
83
|
+
indentWidth: typeof indent === "number" ? indent : 2,
|
|
84
|
+
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
85
|
+
useTabs: indent === "tab"
|
|
86
|
+
},
|
|
87
|
+
options.dprintOptions || {}
|
|
88
|
+
);
|
|
89
|
+
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
|
90
|
+
const configs = [
|
|
91
|
+
{
|
|
92
|
+
name: "nuxt/formatter/setup",
|
|
93
|
+
plugins: {
|
|
94
|
+
format: pluginFormat
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
if (options.css) {
|
|
99
|
+
configs.push(
|
|
100
|
+
{
|
|
101
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parser: parserPlain
|
|
104
|
+
},
|
|
105
|
+
name: "nuxt/formatter/css",
|
|
106
|
+
rules: {
|
|
107
|
+
"format/prettier": [
|
|
108
|
+
"error",
|
|
109
|
+
mergePrettierOptions(prettierOptions, {
|
|
110
|
+
parser: "css"
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
files: [GLOB_SCSS],
|
|
117
|
+
languageOptions: {
|
|
118
|
+
parser: parserPlain
|
|
119
|
+
},
|
|
120
|
+
name: "nuxt/formatter/scss",
|
|
121
|
+
rules: {
|
|
122
|
+
"format/prettier": [
|
|
123
|
+
"error",
|
|
124
|
+
mergePrettierOptions(prettierOptions, {
|
|
125
|
+
parser: "scss"
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
files: [GLOB_LESS],
|
|
132
|
+
languageOptions: {
|
|
133
|
+
parser: parserPlain
|
|
134
|
+
},
|
|
135
|
+
name: "nuxt/formatter/less",
|
|
136
|
+
rules: {
|
|
137
|
+
"format/prettier": [
|
|
138
|
+
"error",
|
|
139
|
+
mergePrettierOptions(prettierOptions, {
|
|
140
|
+
parser: "less"
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
if (options.html) {
|
|
148
|
+
configs.push({
|
|
149
|
+
files: [GLOB_HTML],
|
|
150
|
+
languageOptions: {
|
|
151
|
+
parser: parserPlain
|
|
152
|
+
},
|
|
153
|
+
name: "nuxt/formatter/html",
|
|
154
|
+
rules: {
|
|
155
|
+
"format/prettier": [
|
|
156
|
+
"error",
|
|
157
|
+
mergePrettierOptions(prettierOptions, {
|
|
158
|
+
parser: "html"
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (options.xml) {
|
|
165
|
+
configs.push({
|
|
166
|
+
files: [GLOB_XML],
|
|
167
|
+
languageOptions: {
|
|
168
|
+
parser: parserPlain
|
|
169
|
+
},
|
|
170
|
+
name: "nuxt/formatter/xml",
|
|
171
|
+
rules: {
|
|
172
|
+
"format/prettier": [
|
|
173
|
+
"error",
|
|
174
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
175
|
+
parser: "xml",
|
|
176
|
+
plugins: [
|
|
177
|
+
"@prettier/plugin-xml"
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (options.svg) {
|
|
185
|
+
configs.push({
|
|
186
|
+
files: [GLOB_SVG],
|
|
187
|
+
languageOptions: {
|
|
188
|
+
parser: parserPlain
|
|
189
|
+
},
|
|
190
|
+
name: "nuxt/formatter/svg",
|
|
191
|
+
rules: {
|
|
192
|
+
"format/prettier": [
|
|
193
|
+
"error",
|
|
194
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
195
|
+
parser: "xml",
|
|
196
|
+
plugins: [
|
|
197
|
+
"@prettier/plugin-xml"
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (options.markdown) {
|
|
205
|
+
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
206
|
+
configs.push({
|
|
207
|
+
files: [GLOB_MARKDOWN],
|
|
208
|
+
languageOptions: {
|
|
209
|
+
parser: parserPlain
|
|
210
|
+
},
|
|
211
|
+
name: "nuxt/formatter/markdown",
|
|
212
|
+
rules: {
|
|
213
|
+
[`format/${formater}`]: [
|
|
214
|
+
"error",
|
|
215
|
+
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
216
|
+
embeddedLanguageFormatting: "off",
|
|
217
|
+
parser: "markdown"
|
|
218
|
+
}) : {
|
|
219
|
+
...dprintOptions,
|
|
220
|
+
language: "markdown"
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
if (options.graphql) {
|
|
227
|
+
configs.push({
|
|
228
|
+
files: [GLOB_GRAPHQL],
|
|
229
|
+
languageOptions: {
|
|
230
|
+
parser: parserPlain
|
|
231
|
+
},
|
|
232
|
+
name: "nuxt/formatter/graphql",
|
|
233
|
+
rules: {
|
|
234
|
+
"format/prettier": [
|
|
235
|
+
"error",
|
|
236
|
+
mergePrettierOptions(prettierOptions, {
|
|
237
|
+
parser: "graphql"
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return configs;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { formatters };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const eslint_config = require('../shared/eslint.Bh1W2iVQ.cjs');
|
|
4
|
+
require('node:process');
|
|
5
|
+
require('@antfu/eslint-config');
|
|
6
|
+
require('node:fs');
|
|
7
|
+
require('node:path');
|
|
8
|
+
require('node:fs/promises');
|
|
9
|
+
require('node:url');
|
|
10
|
+
require('node:module');
|
|
11
|
+
require('node:assert');
|
|
12
|
+
require('node:v8');
|
|
13
|
+
require('node:util');
|
|
14
|
+
require('../shared/eslint.Dhg0jKDi.cjs');
|
|
15
|
+
require('eslint');
|
|
16
|
+
require('eslint/use-at-your-own-risk');
|
|
17
|
+
require('@saasmakers/eslint');
|
|
18
|
+
require('@vitest/eslint-plugin');
|
|
19
|
+
require('eslint-plugin-package-json');
|
|
20
|
+
require('eslint-plugin-storybook');
|
|
21
|
+
require('eslint-plugin-turbo');
|
|
22
|
+
require('eslint-plugin-zod');
|
|
23
|
+
|
|
24
|
+
async function imports(options) {
|
|
25
|
+
const resolved = eslint_config.resolveOptions(options);
|
|
26
|
+
if (resolved.features.import === false) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const importOptions = resolved.features.import === true ? {} : resolved.features.import || {};
|
|
30
|
+
const plugin = importOptions.package === "eslint-plugin-import-lite" ? (await import('./index3.cjs')).default : (await import('./index4.cjs')).default;
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
name: "nuxt/import/rules",
|
|
34
|
+
plugins: {
|
|
35
|
+
import: plugin
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
...importOptions.package === "eslint-plugin-import-lite" ? {
|
|
39
|
+
"import/consistent-type-specifier-style": ["error", "top-level"]
|
|
40
|
+
} : {},
|
|
41
|
+
"import/first": "error",
|
|
42
|
+
"import/no-duplicates": "error",
|
|
43
|
+
"import/no-mutable-exports": "error",
|
|
44
|
+
"import/no-named-default": "error",
|
|
45
|
+
...resolved.features.stylistic ? {
|
|
46
|
+
"import/newline-after-import": ["error", { count: 1 }]
|
|
47
|
+
} : {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.default = imports;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { r as resolveOptions } from '../shared/eslint.DuJbNenz.mjs';
|
|
2
|
+
import 'node:process';
|
|
3
|
+
import '@antfu/eslint-config';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import 'node:path';
|
|
6
|
+
import 'node:fs/promises';
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'node:module';
|
|
9
|
+
import 'node:assert';
|
|
10
|
+
import 'node:v8';
|
|
11
|
+
import 'node:util';
|
|
12
|
+
import '../shared/eslint.B3ywQ3NK.mjs';
|
|
13
|
+
import 'eslint';
|
|
14
|
+
import 'eslint/use-at-your-own-risk';
|
|
15
|
+
import '@saasmakers/eslint';
|
|
16
|
+
import '@vitest/eslint-plugin';
|
|
17
|
+
import 'eslint-plugin-package-json';
|
|
18
|
+
import 'eslint-plugin-storybook';
|
|
19
|
+
import 'eslint-plugin-turbo';
|
|
20
|
+
import 'eslint-plugin-zod';
|
|
21
|
+
|
|
22
|
+
async function imports(options) {
|
|
23
|
+
const resolved = resolveOptions(options);
|
|
24
|
+
if (resolved.features.import === false) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const importOptions = resolved.features.import === true ? {} : resolved.features.import || {};
|
|
28
|
+
const plugin = importOptions.package === "eslint-plugin-import-lite" ? (await import('./index3.mjs')).default : (await import('./index4.mjs')).default;
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
name: "nuxt/import/rules",
|
|
32
|
+
plugins: {
|
|
33
|
+
import: plugin
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
...importOptions.package === "eslint-plugin-import-lite" ? {
|
|
37
|
+
"import/consistent-type-specifier-style": ["error", "top-level"]
|
|
38
|
+
} : {},
|
|
39
|
+
"import/first": "error",
|
|
40
|
+
"import/no-duplicates": "error",
|
|
41
|
+
"import/no-mutable-exports": "error",
|
|
42
|
+
"import/no-named-default": "error",
|
|
43
|
+
...resolved.features.stylistic ? {
|
|
44
|
+
"import/newline-after-import": ["error", { count: 1 }]
|
|
45
|
+
} : {}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { imports as default };
|