eslint-config-un 1.0.0-alpha.43 → 1.0.0-alpha.44
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.mjs +14 -10
- package/dist/vue.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -284,6 +284,7 @@ const resolveConfigAsyncData = async (context, options) => {
|
|
|
284
284
|
const cacheData = "cachedData" in options ? options.cachedData : null;
|
|
285
285
|
const cachedConfigsByName = Object.fromEntries((cacheData?.configs || []).map((config) => config.name ? [config.name, config] : null).filter((v) => v != null));
|
|
286
286
|
const packagesToManuallyInstallOrUpdate = /* @__PURE__ */ new Map();
|
|
287
|
+
const packagesToManuallyInstallPluginPrefixes = /* @__PURE__ */ new Map();
|
|
287
288
|
const configModifyFns = [];
|
|
288
289
|
const modifyConfigs = () => {
|
|
289
290
|
configModifyFns.forEach((fn) => {
|
|
@@ -296,10 +297,10 @@ const resolveConfigAsyncData = async (context, options) => {
|
|
|
296
297
|
const plugin = pluginResult?.module;
|
|
297
298
|
if (pluginResult && "packageName" in pluginResult) {
|
|
298
299
|
const packageToInstall = await checkIfModuleCorrectlyLoaded(pluginResult);
|
|
299
|
-
if (packageToInstall)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
300
|
+
if (packageToInstall) {
|
|
301
|
+
packagesToManuallyInstallOrUpdate.set(packageToInstall.name, packageToInstall);
|
|
302
|
+
packagesToManuallyInstallPluginPrefixes.set(packageToInstall.name, new Set([...packagesToManuallyInstallPluginPrefixes.get(packageToInstall.name) || [], pluginPrefix]));
|
|
303
|
+
}
|
|
303
304
|
}
|
|
304
305
|
if (pluginPrefix) {
|
|
305
306
|
const isProvided = rootOptions.pluginOverrides?.[pluginPrefix] != null;
|
|
@@ -344,13 +345,16 @@ const resolveConfigAsyncData = async (context, options) => {
|
|
|
344
345
|
})), (item) => item.installedVersion != null).forEach((packages, index) => {
|
|
345
346
|
if (packages.length === 0) return;
|
|
346
347
|
const isUpdates = index === 0;
|
|
347
|
-
const packageTypes = partition(packages, (item) =>
|
|
348
|
+
const packageTypes = partition(packages, (item) => packagesToManuallyInstallPluginPrefixes.has(item.name)).map((packagesOfType, i) => packagesOfType.length > 0 && `${i === 0 ? "plugin" : "package"}${packagesOfType.length === 1 ? "" : "s"}`).filter(Boolean).join(" and ");
|
|
348
349
|
context.logger[isUpdates ? "warn" : "fatal"](`${capitalize(packageTypes)} that listed in optional peer dependencies ${packages.length === 1 ? "was" : "were"} used, but ${isUpdates ? "does not satisfy the supported version range" : "not installed"}. Please ${isUpdates ? "update" : "install"} ${packages.length === 1 ? "it" : "them"} by yourself or disable corresponding config${packages.length === 1 ? "" : "s"} in order for this error to disappear:
|
|
349
|
-
${renderTable(packages.toSorted((a, b) => a.name.localeCompare(b.name)).map(({ name, versionRange
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
350
|
+
${renderTable(packages.toSorted((a, b) => a.name.localeCompare(b.name)).map(({ name, versionRange }) => {
|
|
351
|
+
const pluginPrefixes = packagesToManuallyInstallPluginPrefixes.get(name);
|
|
352
|
+
return {
|
|
353
|
+
Name: stylePackageName(name),
|
|
354
|
+
"Required version range": versionRange ? styleText("green", versionRange) : styleText("gray", "Unknown"),
|
|
355
|
+
...pluginPrefixes?.size && { [`PLugin prefix${pluginPrefixes.size === 1 ? "" : "s"}`]: [...pluginPrefixes].map(stylePluginPrefix).join(", ") }
|
|
356
|
+
};
|
|
357
|
+
}))}`);
|
|
354
358
|
});
|
|
355
359
|
const autofixDisabledGloballyFor = autofixDisabledGloballyForRaw === true ? true : autofixDisabledGloballyForRaw === false ? {} : {
|
|
356
360
|
...autofixDisabledGloballyForRaw,
|
package/dist/vue.mjs
CHANGED
|
@@ -138,7 +138,7 @@ var vue_default = (async (context, optionsRaw, { vanillaFinalFlatConfigRules })
|
|
|
138
138
|
}]).addRule("no-v-text", OFF).addRule("padding-line-between-blocks", ERROR).addRule("padding-line-between-tags", OFF).addRule("padding-lines-in-component-definition", ERROR, [{ withinOption: { props: "ignore" } }]).addRule("prefer-define-options", isMin3_3 ? ERROR : OFF).addRule("prefer-prop-type-boolean-first", ERROR).addRule("prefer-separate-static-class", ERROR).addRule("prefer-true-attribute-shorthand", ERROR).addRule("prefer-use-template-ref", preferUseTemplateRef ? ERROR : OFF).addRule("require-default-export", ERROR).addRule("require-direct-export", ERROR).addRule("require-emit-validator", OFF).addRule("require-explicit-slots", isMin3_3 ? ERROR : OFF).addRule("require-expose", OFF).addRule("require-macro-variable-name", ERROR).addRule("require-name-property", OFF).addRule("require-prop-comment", OFF).addRule("require-typed-object-prop", ERROR).addRule("require-typed-ref", ERROR).addRule("restricted-component-names", OFF).addRule("script-indent", OFF).addRule("slot-name-casing", ERROR).addRule("sort-keys", OFF).addRule("static-class-names-order", OFF).addRule("v-for-delimiter-style", ERROR, ["in"]).addRule("v-if-else-key", vue2Severity(ERROR)).addRule("v-on-handler-style", ERROR, ["inline"]).addRule("valid-define-options", isMin3_3 ? ERROR : OFF).markCategory("Extension Rules").addRule("array-bracket-newline", OFF).addRule("array-bracket-spacing", OFF).addRule("array-element-newline", OFF).addRule("arrow-spacing", OFF).addRule("block-spacing", OFF).addRule("brace-style", OFF).addRule("camelcase", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules.camelcase ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("comma-dangle", OFF).addRule("comma-spacing", OFF).addRule("comma-style", OFF).addRule("dot-location", OFF).addRule("dot-notation", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["dot-notation"] ?? ERROR, [optionsResolved.noPropertyAccessFromIndexSignatureSetInTsconfigForVueFiles ? OFF : ERROR, inheritFromBase ? void 0 : []])).addRule("eqeqeq", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules.eqeqeq ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("func-call-spacing", OFF).addRule("key-spacing", OFF).addRule("keyword-spacing", OFF).addRule("max-len", OFF).addRule("multiline-ternary", OFF).addRule("no-console", ERROR).addRule("no-constant-condition", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-constant-condition"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-empty-pattern", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-empty-pattern"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-extra-parens", OFF).addRule("no-implicit-coercion", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-implicit-coercion"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-irregular-whitespace", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-irregular-whitespace"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-loss-of-precision", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-loss-of-precision"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-negated-condition", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-negated-condition"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-restricted-syntax", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-restricted-syntax"] ?? OFF, inheritFromBase ? void 0 : [OFF])).addRule("no-sparse-arrays", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-sparse-arrays"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("no-useless-concat", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["no-useless-concat"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("object-curly-newline", OFF).addRule("object-curly-spacing", OFF).addRule("object-property-newline", OFF).addRule("object-shorthand", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["object-shorthand"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("operator-linebreak", OFF).addRule("prefer-template", ...getRuleUnSeverityAndOptionsFromEntry(vanillaFinalFlatConfigRules["prefer-template"] ?? ERROR, inheritFromBase ? void 0 : [ERROR])).addRule("quote-props", OFF).addRule("space-in-parens", OFF).addRule("space-infix-ops", OFF).addRule("space-unary-ops", OFF).addRule("template-curly-spacing", OFF).disableAnyRule("ts", "prefer-function-type").disableAnyRule("ts", "unified-signatures").disableAnyRule("import", "first").disableAnyRule("import", "no-default-export").disableAnyRule("", "no-useless-assignment").enableConfigTesterForPlugin("vue").addOverrides();
|
|
139
139
|
const resolvePathInVueOrNuxtProjectDir = joinPaths.bind(null, optionsResolved.vueOrNuxtProjectDir);
|
|
140
140
|
const configBuilderNuxt = context.createConfigBuilder(optionsNuxtResolved, "nuxt");
|
|
141
|
-
configBuilderNuxt?.addConfig(["vue/nuxt", {
|
|
141
|
+
if (configNuxt) configBuilderNuxt?.addConfig(["vue/nuxt", {
|
|
142
142
|
includeDefaultFilesAndIgnores: true,
|
|
143
143
|
filesFallback: [resolvePathInVueOrNuxtProjectDir("**/*.vue")]
|
|
144
144
|
}]).addAnyRule("nuxt", "prefer-import-meta", ERROR).addOverrides().enableConfigTesterForPlugin("nuxt", { rulesToSkipInConfig: ["nuxt-config-keys-order"] });
|