@exbotanical/eslint-config 1.0.0 → 1.1.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.
- package/dist/index.d.ts +29 -12
- package/dist/index.js +144 -111
- package/package.json +13 -4
package/dist/index.d.ts
CHANGED
|
@@ -1952,6 +1952,7 @@ type Rules = RuleOptions;
|
|
|
1952
1952
|
type FlatConfigRecord = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'> & {
|
|
1953
1953
|
plugins?: Record<string, any>;
|
|
1954
1954
|
};
|
|
1955
|
+
type Awaitable<T> = T | Promise<T>;
|
|
1955
1956
|
|
|
1956
1957
|
interface OptionsIgnores extends AllOptions {
|
|
1957
1958
|
files?: string[];
|
|
@@ -1978,6 +1979,11 @@ interface OptionsTypescript extends AllOptions, OptionsTypeScriptParser {
|
|
|
1978
1979
|
typeAwareOverrides?: FlatConfigRecord['rules'];
|
|
1979
1980
|
}
|
|
1980
1981
|
|
|
1982
|
+
interface OptionsVue extends AllOptions, OptionsHasTypeScript {
|
|
1983
|
+
vueVersion?: 2 | 3;
|
|
1984
|
+
graphql?: boolean;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1981
1987
|
interface OptionsOverrides {
|
|
1982
1988
|
overrides?: FlatConfigRecord['rules'];
|
|
1983
1989
|
}
|
|
@@ -2022,7 +2028,7 @@ interface OptionsConfig extends OptionsProjectType {
|
|
|
2022
2028
|
/**
|
|
2023
2029
|
* Core ruleset. Cannot be disabled.
|
|
2024
2030
|
*/
|
|
2025
|
-
javascript?: OptionsOverrides;
|
|
2031
|
+
javascript?: OptionsOverrides & OptionsFiles;
|
|
2026
2032
|
/**
|
|
2027
2033
|
* Enables TypeScript support.
|
|
2028
2034
|
*
|
|
@@ -2039,23 +2045,24 @@ interface OptionsConfig extends OptionsProjectType {
|
|
|
2039
2045
|
* Enables Vue rules.
|
|
2040
2046
|
*
|
|
2041
2047
|
* Requires installing:
|
|
2042
|
-
* -
|
|
2043
|
-
* -
|
|
2048
|
+
* - eslint-plugin-vue
|
|
2049
|
+
* - vue-eslint-parser
|
|
2050
|
+
* - eslint-processor-vue-blocks (only if embedded graphql is enabled)
|
|
2044
2051
|
*
|
|
2045
2052
|
* @default false
|
|
2046
2053
|
*/
|
|
2047
|
-
vue?: boolean |
|
|
2054
|
+
vue?: boolean | OptionsVue;
|
|
2048
2055
|
/**
|
|
2049
2056
|
* Enables React rules.
|
|
2050
2057
|
*
|
|
2051
2058
|
* Requires installing:
|
|
2052
|
-
* -
|
|
2053
|
-
* -
|
|
2054
|
-
* -
|
|
2059
|
+
* - @eslint-react/eslint-plugin
|
|
2060
|
+
* - eslint-plugin-react-hooks
|
|
2061
|
+
* - eslint-plugin-react-refresh
|
|
2055
2062
|
*
|
|
2056
2063
|
* @default false
|
|
2057
2064
|
*/
|
|
2058
|
-
react?: boolean | OptionsOverrides;
|
|
2065
|
+
react?: boolean | (OptionsOverrides & OptionsFiles);
|
|
2059
2066
|
/**
|
|
2060
2067
|
* Enables JSONC support.
|
|
2061
2068
|
*/
|
|
@@ -2065,7 +2072,7 @@ interface OptionsConfig extends OptionsProjectType {
|
|
|
2065
2072
|
*
|
|
2066
2073
|
* @default true
|
|
2067
2074
|
*/
|
|
2068
|
-
yaml?: boolean | OptionsOverrides;
|
|
2075
|
+
yaml?: boolean | (OptionsOverrides & OptionsFiles);
|
|
2069
2076
|
/**
|
|
2070
2077
|
* Enables TOML support.
|
|
2071
2078
|
*
|
|
@@ -2077,7 +2084,7 @@ interface OptionsConfig extends OptionsProjectType {
|
|
|
2077
2084
|
* TODO: update rules
|
|
2078
2085
|
* @default true
|
|
2079
2086
|
*/
|
|
2080
|
-
markdown?: boolean | OptionsOverrides;
|
|
2087
|
+
markdown?: boolean | (OptionsOverrides & OptionsFiles);
|
|
2081
2088
|
/**
|
|
2082
2089
|
* Configurable global ignores.
|
|
2083
2090
|
*/
|
|
@@ -2092,6 +2099,16 @@ interface OptionsConfig extends OptionsProjectType {
|
|
|
2092
2099
|
* @default true
|
|
2093
2100
|
*/
|
|
2094
2101
|
formatter?: boolean;
|
|
2102
|
+
/**
|
|
2103
|
+
* Enables graphql linting.
|
|
2104
|
+
*
|
|
2105
|
+
* Requires installing:
|
|
2106
|
+
* - @graphql-eslint/eslint-plugin
|
|
2107
|
+
* - eslint-processor-vue-blocks (only if graphql embedded in vue is enabled)
|
|
2108
|
+
|
|
2109
|
+
* @default false
|
|
2110
|
+
*/
|
|
2111
|
+
graphql?: boolean | (OptionsOverrides & OptionsFiles);
|
|
2095
2112
|
}
|
|
2096
2113
|
interface OptionsStyle {
|
|
2097
2114
|
indent?: number | 'tab';
|
|
@@ -2101,6 +2118,6 @@ interface OptionsStyle {
|
|
|
2101
2118
|
}
|
|
2102
2119
|
|
|
2103
2120
|
type LinterOptions = OptionsConfig;
|
|
2104
|
-
declare function exbotanical({ javascript: optionsJavascript, ignores: optionsIgnore, jsonc: optionsJsonc, markdown: optionsMarkdown, toml: optionsToml, yaml: optionsYaml, test: optionsTest, formatter, typescript: optionsTypescript, style: optionsStyle, react: optionsReact, vue: optionsVue,
|
|
2121
|
+
declare function exbotanical({ javascript: optionsJavascript, ignores: optionsIgnore, jsonc: optionsJsonc, markdown: optionsMarkdown, toml: optionsToml, yaml: optionsYaml, test: optionsTest, formatter, typescript: optionsTypescript, style: optionsStyle, react: optionsReact, vue: optionsVue, graphql: optionsGraphql, type, }: LinterOptions, ...userConfigs: Awaitable<FlatConfigRecord | FlatConfigRecord[] | Linter.Config[]>[]): Promise<FlatConfigRecord[]>;
|
|
2105
2122
|
|
|
2106
|
-
export { type AllOptions, type FlatConfigRecord, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsOverrides, type OptionsProjectType, type OptionsStyle, type OptionsTypeScriptParser, type Rules, exbotanical as default };
|
|
2123
|
+
export { type AllOptions, type Awaitable, type FlatConfigRecord, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsOverrides, type OptionsProjectType, type OptionsStyle, type OptionsTypeScriptParser, type Rules, exbotanical as default };
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ async function comments() {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/filepaths.ts
|
|
27
|
+
var GLOB_JS = "**/*.?([cm])js";
|
|
27
28
|
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
28
29
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
29
30
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
@@ -36,6 +37,7 @@ var GLOB_MARKDOWN = "**/*.md";
|
|
|
36
37
|
var GLOB_VUE = "**/*.vue";
|
|
37
38
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
38
39
|
var GLOB_TOML = "**/*.toml";
|
|
40
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
39
41
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
40
42
|
var GLOB_TESTS = [
|
|
41
43
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -116,6 +118,110 @@ async function disables() {
|
|
|
116
118
|
];
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
// src/utils.ts
|
|
122
|
+
import { fileURLToPath } from "node:url";
|
|
123
|
+
import { isPackageExists } from "local-pkg";
|
|
124
|
+
var parserPlain = {
|
|
125
|
+
meta: {
|
|
126
|
+
name: "parser-plain"
|
|
127
|
+
},
|
|
128
|
+
parseForESLint: (code) => ({
|
|
129
|
+
ast: {
|
|
130
|
+
body: [],
|
|
131
|
+
comments: [],
|
|
132
|
+
loc: { end: code.length, start: 0 },
|
|
133
|
+
range: [0, code.length],
|
|
134
|
+
tokens: [],
|
|
135
|
+
type: "Program"
|
|
136
|
+
},
|
|
137
|
+
scopeManager: null,
|
|
138
|
+
services: { isPlain: true },
|
|
139
|
+
visitorKeys: {
|
|
140
|
+
Program: []
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
};
|
|
144
|
+
async function interopDefault(module) {
|
|
145
|
+
const resolved = await module;
|
|
146
|
+
return resolved.default || resolved;
|
|
147
|
+
}
|
|
148
|
+
function renameRules(rules, map) {
|
|
149
|
+
return Object.fromEntries(
|
|
150
|
+
Object.entries(rules).map(([key, value]) => {
|
|
151
|
+
for (const [from, to] of Object.entries(map)) {
|
|
152
|
+
if (key.startsWith(`${from}/`))
|
|
153
|
+
return [to + key.slice(from.length), value];
|
|
154
|
+
}
|
|
155
|
+
return [key, value];
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function mergeProcessors(processors) {
|
|
160
|
+
const cache = /* @__PURE__ */ new Map();
|
|
161
|
+
return {
|
|
162
|
+
meta: {
|
|
163
|
+
name: `merged-processor:${processors.map((processor) => processor.meta?.name || "unknown").join("+")}`
|
|
164
|
+
},
|
|
165
|
+
supportsAutofix: true,
|
|
166
|
+
preprocess(text, filename) {
|
|
167
|
+
const counts = [];
|
|
168
|
+
cache.set(filename, counts);
|
|
169
|
+
return processors.flatMap((processor) => {
|
|
170
|
+
const result = processor.preprocess?.(text, filename) || [];
|
|
171
|
+
counts.push(result.length);
|
|
172
|
+
return result;
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
postprocess(messages, filename) {
|
|
176
|
+
const counts = cache.get(filename);
|
|
177
|
+
cache.delete(filename);
|
|
178
|
+
let index = 0;
|
|
179
|
+
return processors.flatMap((processor, index_) => {
|
|
180
|
+
const msgs = messages.slice(index, index + counts[index_]);
|
|
181
|
+
index += counts[index_];
|
|
182
|
+
return processor.postprocess?.(msgs, filename) || [];
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
var processorPassThrough = {
|
|
188
|
+
meta: {
|
|
189
|
+
name: "pass-through"
|
|
190
|
+
},
|
|
191
|
+
preprocess(text) {
|
|
192
|
+
return [text];
|
|
193
|
+
},
|
|
194
|
+
postprocess(messages) {
|
|
195
|
+
return messages[0];
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
199
|
+
|
|
200
|
+
// src/configs/graphql.ts
|
|
201
|
+
async function graphql() {
|
|
202
|
+
const graphqlPlugin = await interopDefault(import("@graphql-eslint/eslint-plugin"));
|
|
203
|
+
const rules = {
|
|
204
|
+
...graphqlPlugin.configs["flat/operations-recommended"].rules,
|
|
205
|
+
...graphqlPlugin.configs["flat/schema-recommended"].rules
|
|
206
|
+
};
|
|
207
|
+
return [
|
|
208
|
+
{
|
|
209
|
+
files: [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
|
|
210
|
+
processor: graphqlPlugin.processor
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
files: [GLOB_GRAPHQL],
|
|
214
|
+
languageOptions: {
|
|
215
|
+
parser: graphqlPlugin.parser
|
|
216
|
+
},
|
|
217
|
+
plugins: {
|
|
218
|
+
"@graphql-eslint": graphqlPlugin
|
|
219
|
+
},
|
|
220
|
+
rules
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
|
|
119
225
|
// src/configs/ignores.ts
|
|
120
226
|
var NAMESPACE3 = "exbotanical/ignores";
|
|
121
227
|
async function ignores({ files = [] } = {}) {
|
|
@@ -254,7 +360,8 @@ async function javascript({ overrides = {} } = {}) {
|
|
|
254
360
|
"no-dupe-else-if": ["error"],
|
|
255
361
|
"no-dupe-keys": ["error"],
|
|
256
362
|
"no-duplicate-case": ["error"],
|
|
257
|
-
|
|
363
|
+
// See `import` ruleset
|
|
364
|
+
"no-duplicate-imports": ["off"],
|
|
258
365
|
"no-empty-character-class": ["error"],
|
|
259
366
|
"no-empty-pattern": ["error"],
|
|
260
367
|
"no-unsafe-finally": ["error"],
|
|
@@ -468,85 +575,6 @@ async function javascript({ overrides = {} } = {}) {
|
|
|
468
575
|
];
|
|
469
576
|
}
|
|
470
577
|
|
|
471
|
-
// src/utils.ts
|
|
472
|
-
import { fileURLToPath } from "node:url";
|
|
473
|
-
import { isPackageExists } from "local-pkg";
|
|
474
|
-
var parserPlain = {
|
|
475
|
-
meta: {
|
|
476
|
-
name: "parser-plain"
|
|
477
|
-
},
|
|
478
|
-
parseForESLint: (code) => ({
|
|
479
|
-
ast: {
|
|
480
|
-
body: [],
|
|
481
|
-
comments: [],
|
|
482
|
-
loc: { end: code.length, start: 0 },
|
|
483
|
-
range: [0, code.length],
|
|
484
|
-
tokens: [],
|
|
485
|
-
type: "Program"
|
|
486
|
-
},
|
|
487
|
-
scopeManager: null,
|
|
488
|
-
services: { isPlain: true },
|
|
489
|
-
visitorKeys: {
|
|
490
|
-
Program: []
|
|
491
|
-
}
|
|
492
|
-
})
|
|
493
|
-
};
|
|
494
|
-
async function interopDefault(module) {
|
|
495
|
-
const resolved = await module;
|
|
496
|
-
return resolved.default || resolved;
|
|
497
|
-
}
|
|
498
|
-
function renameRules(rules, map) {
|
|
499
|
-
return Object.fromEntries(
|
|
500
|
-
Object.entries(rules).map(([key, value]) => {
|
|
501
|
-
for (const [from, to] of Object.entries(map)) {
|
|
502
|
-
if (key.startsWith(`${from}/`))
|
|
503
|
-
return [to + key.slice(from.length), value];
|
|
504
|
-
}
|
|
505
|
-
return [key, value];
|
|
506
|
-
})
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
function mergeProcessors(processors) {
|
|
510
|
-
const cache = /* @__PURE__ */ new Map();
|
|
511
|
-
return {
|
|
512
|
-
meta: {
|
|
513
|
-
name: `merged-processor:${processors.map((processor) => processor.meta?.name || "unknown").join("+")}`
|
|
514
|
-
},
|
|
515
|
-
supportsAutofix: true,
|
|
516
|
-
preprocess(text, filename) {
|
|
517
|
-
const counts = [];
|
|
518
|
-
cache.set(filename, counts);
|
|
519
|
-
return processors.flatMap((processor) => {
|
|
520
|
-
const result = processor.preprocess?.(text, filename) || [];
|
|
521
|
-
counts.push(result.length);
|
|
522
|
-
return result;
|
|
523
|
-
});
|
|
524
|
-
},
|
|
525
|
-
postprocess(messages, filename) {
|
|
526
|
-
const counts = cache.get(filename);
|
|
527
|
-
cache.delete(filename);
|
|
528
|
-
let index = 0;
|
|
529
|
-
return processors.flatMap((processor, index_) => {
|
|
530
|
-
const msgs = messages.slice(index, index + counts[index_]);
|
|
531
|
-
index += counts[index_];
|
|
532
|
-
return processor.postprocess?.(msgs, filename) || [];
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
var processorPassThrough = {
|
|
538
|
-
meta: {
|
|
539
|
-
name: "pass-through"
|
|
540
|
-
},
|
|
541
|
-
preprocess(text) {
|
|
542
|
-
return [text];
|
|
543
|
-
},
|
|
544
|
-
postprocess(messages) {
|
|
545
|
-
return messages[0];
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
549
|
-
|
|
550
578
|
// src/configs/jsdoc.ts
|
|
551
579
|
var NAMESPACE6 = "exbotanical/jsdoc";
|
|
552
580
|
async function jsdoc() {
|
|
@@ -1821,11 +1849,13 @@ async function vue({
|
|
|
1821
1849
|
files = [GLOB_VUE],
|
|
1822
1850
|
overrides = {},
|
|
1823
1851
|
typescript: typescript2 = true,
|
|
1824
|
-
vueVersion = 3
|
|
1852
|
+
vueVersion = 3,
|
|
1853
|
+
graphql: graphql2 = false
|
|
1825
1854
|
}, { indent } = STYLE_DEFAULTS) {
|
|
1826
|
-
const [pluginVue, parserVue] = await Promise.all([
|
|
1855
|
+
const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
|
|
1827
1856
|
interopDefault(import("eslint-plugin-vue")),
|
|
1828
|
-
interopDefault(import("vue-eslint-parser"))
|
|
1857
|
+
interopDefault(import("vue-eslint-parser")),
|
|
1858
|
+
interopDefault(import("eslint-processor-vue-blocks"))
|
|
1829
1859
|
]);
|
|
1830
1860
|
return [
|
|
1831
1861
|
{
|
|
@@ -1866,7 +1896,16 @@ async function vue({
|
|
|
1866
1896
|
sourceType: "module"
|
|
1867
1897
|
}
|
|
1868
1898
|
},
|
|
1869
|
-
processor: pluginVue.processors[".vue"]
|
|
1899
|
+
processor: graphql2 === false ? pluginVue.processors[".vue"] : mergeProcessors([
|
|
1900
|
+
pluginVue.processors[".vue"],
|
|
1901
|
+
processorVueBlocks({
|
|
1902
|
+
blocks: {
|
|
1903
|
+
script: true,
|
|
1904
|
+
scriptSetup: true,
|
|
1905
|
+
customBlocks: true
|
|
1906
|
+
}
|
|
1907
|
+
})
|
|
1908
|
+
]),
|
|
1870
1909
|
rules: {
|
|
1871
1910
|
...pluginVue.configs.base.rules,
|
|
1872
1911
|
...vueVersion === 2 ? {
|
|
@@ -1893,12 +1932,7 @@ async function vue({
|
|
|
1893
1932
|
"vue/define-macros-order": [
|
|
1894
1933
|
"error",
|
|
1895
1934
|
{
|
|
1896
|
-
order: [
|
|
1897
|
-
"defineOptions",
|
|
1898
|
-
"defineProps",
|
|
1899
|
-
"defineEmits",
|
|
1900
|
-
"defineSlots"
|
|
1901
|
-
]
|
|
1935
|
+
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
1902
1936
|
}
|
|
1903
1937
|
],
|
|
1904
1938
|
"vue/dot-location": ["error", "property"],
|
|
@@ -2050,19 +2084,20 @@ async function exbotanical({
|
|
|
2050
2084
|
style: optionsStyle = STYLE_DEFAULTS,
|
|
2051
2085
|
react: optionsReact,
|
|
2052
2086
|
vue: optionsVue,
|
|
2053
|
-
|
|
2054
|
-
|
|
2087
|
+
graphql: optionsGraphql,
|
|
2088
|
+
type
|
|
2089
|
+
}, ...userConfigs) {
|
|
2055
2090
|
const configs2 = [
|
|
2056
2091
|
perfectionist(),
|
|
2057
2092
|
unicorn(),
|
|
2058
2093
|
comments(),
|
|
2059
2094
|
imports(),
|
|
2060
|
-
javascript({ ...optionsJavascript,
|
|
2095
|
+
javascript({ ...optionsJavascript, type }),
|
|
2061
2096
|
jsdoc(),
|
|
2062
2097
|
jsx(),
|
|
2063
2098
|
node(),
|
|
2064
2099
|
regexpr(),
|
|
2065
|
-
test({ ...factoryConfig(optionsTest)
|
|
2100
|
+
test({ ...factoryConfig(optionsTest) })
|
|
2066
2101
|
];
|
|
2067
2102
|
if (optionsJsonc) {
|
|
2068
2103
|
configs2.push(
|
|
@@ -2070,41 +2105,39 @@ async function exbotanical({
|
|
|
2070
2105
|
tsconfig(),
|
|
2071
2106
|
jsonc({
|
|
2072
2107
|
...factoryConfig(optionsJsonc),
|
|
2073
|
-
...optionsStyle
|
|
2074
|
-
...otherOptions
|
|
2108
|
+
...optionsStyle
|
|
2075
2109
|
})
|
|
2076
2110
|
);
|
|
2077
2111
|
}
|
|
2078
2112
|
if (optionsMarkdown) {
|
|
2079
|
-
configs2.push(
|
|
2080
|
-
|
|
2081
|
-
|
|
2113
|
+
configs2.push(markdown({ ...factoryConfig(optionsMarkdown) }));
|
|
2114
|
+
}
|
|
2115
|
+
if (optionsGraphql) {
|
|
2116
|
+
configs2.push(graphql());
|
|
2082
2117
|
}
|
|
2083
2118
|
if (optionsReact) {
|
|
2084
|
-
configs2.push(react({ ...factoryConfig(optionsReact)
|
|
2119
|
+
configs2.push(react({ ...factoryConfig(optionsReact) }));
|
|
2085
2120
|
}
|
|
2086
2121
|
if (optionsToml) {
|
|
2087
|
-
configs2.push(
|
|
2088
|
-
toml({ ...factoryConfig(optionsToml), ...optionsStyle, ...otherOptions })
|
|
2089
|
-
);
|
|
2122
|
+
configs2.push(toml({ ...factoryConfig(optionsToml), ...optionsStyle }));
|
|
2090
2123
|
}
|
|
2091
2124
|
if (optionsTypescript) {
|
|
2092
|
-
configs2.push(
|
|
2093
|
-
typescript({ ...factoryConfig(optionsTypescript), ...otherOptions })
|
|
2094
|
-
);
|
|
2125
|
+
configs2.push(typescript({ ...factoryConfig(optionsTypescript), type }));
|
|
2095
2126
|
}
|
|
2096
2127
|
if (optionsVue) {
|
|
2097
|
-
configs2.push(vue({ ...factoryConfig(optionsVue),
|
|
2128
|
+
configs2.push(vue({ ...factoryConfig(optionsVue), graphql: !!optionsGraphql }));
|
|
2098
2129
|
}
|
|
2099
2130
|
if (optionsYaml) {
|
|
2100
|
-
configs2.push(
|
|
2101
|
-
yaml({ ...factoryConfig(optionsYaml), ...optionsStyle, ...otherOptions })
|
|
2102
|
-
);
|
|
2131
|
+
configs2.push(yaml({ ...factoryConfig(optionsYaml), ...optionsStyle }));
|
|
2103
2132
|
}
|
|
2104
2133
|
if (formatter) {
|
|
2105
2134
|
configs2.push(prettier());
|
|
2106
2135
|
}
|
|
2107
|
-
configs2.push(disables(), ignores({ ...optionsIgnore
|
|
2136
|
+
configs2.push(disables(), ignores({ ...optionsIgnore }));
|
|
2137
|
+
if (userConfigs.length > 0) {
|
|
2138
|
+
const resolved2 = await Promise.all(userConfigs);
|
|
2139
|
+
configs2.push(...resolved2.map((r) => Promise.resolve(Array.isArray(r) ? r : [r])));
|
|
2140
|
+
}
|
|
2108
2141
|
const resolved = await Promise.all(configs2);
|
|
2109
2142
|
return resolved.flat();
|
|
2110
2143
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exbotanical/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Zito's eslint config",
|
|
7
7
|
"author": "Matthew Zito <exbotanical@protonmail.com> (https://github.com/exbotanical/)",
|
|
@@ -34,22 +34,27 @@
|
|
|
34
34
|
"prepack": "npm run build",
|
|
35
35
|
"prepare": "simple-git-hooks",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
|
-
"release": "npm publish"
|
|
37
|
+
"release": "bumpp && npm publish"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@eslint-react/eslint-plugin": "^1.30.1",
|
|
41
|
+
"@graphql-eslint/eslint-plugin": "^4.3.0",
|
|
41
42
|
"@prettier/plugin-xml": "^3.4.1",
|
|
42
43
|
"eslint": "^9.10.0",
|
|
43
44
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
44
45
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
45
46
|
"eslint-plugin-tap": "^1.2.1",
|
|
46
47
|
"eslint-plugin-vue": "^9.32.0",
|
|
48
|
+
"eslint-processor-vue-blocks": "^2.0.0",
|
|
47
49
|
"vue-eslint-parser": "^9.4.3"
|
|
48
50
|
},
|
|
49
51
|
"peerDependenciesMeta": {
|
|
50
52
|
"@eslint-react/eslint-plugin": {
|
|
51
53
|
"optional": true
|
|
52
54
|
},
|
|
55
|
+
"@graphql-eslint/eslint-plugin": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
53
58
|
"@prettier/plugin-xml": {
|
|
54
59
|
"optional": true
|
|
55
60
|
},
|
|
@@ -65,6 +70,9 @@
|
|
|
65
70
|
"eslint-plugin-vue": {
|
|
66
71
|
"optional": true
|
|
67
72
|
},
|
|
73
|
+
"eslint-processor-vue-blocks": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
68
76
|
"vue-eslint-parser": {
|
|
69
77
|
"optional": true
|
|
70
78
|
}
|
|
@@ -97,7 +105,8 @@
|
|
|
97
105
|
},
|
|
98
106
|
"devDependencies": {
|
|
99
107
|
"@eslint-react/eslint-plugin": "^1.31.0",
|
|
100
|
-
"@
|
|
108
|
+
"@exbotanical/prettier-config": "^1.0.1",
|
|
109
|
+
"@graphql-eslint/eslint-plugin": "^4.3.0",
|
|
101
110
|
"@prettier/plugin-xml": "^3.4.1",
|
|
102
111
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
103
112
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
@@ -107,6 +116,7 @@
|
|
|
107
116
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
108
117
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
109
118
|
"eslint-plugin-vue": "^9.32.0",
|
|
119
|
+
"eslint-processor-vue-blocks": "^2.0.0",
|
|
110
120
|
"jiti": "^2.4.2",
|
|
111
121
|
"lint-staged": "^15.4.3",
|
|
112
122
|
"simple-git-hooks": "^2.11.1",
|
|
@@ -116,7 +126,6 @@
|
|
|
116
126
|
"vitest": "^3.0.7",
|
|
117
127
|
"vue-eslint-parser": "^10.1.1"
|
|
118
128
|
},
|
|
119
|
-
"prettier": "@magister_zito/prettier-config",
|
|
120
129
|
"simple-git-hooks": {
|
|
121
130
|
"pre-commit": "npx lint-staged"
|
|
122
131
|
},
|