eslint-config-un 0.8.0 → 0.8.2
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.cjs +72 -60
- package/dist/index.js +72 -60
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -482,6 +482,7 @@ var getPackageSemverVersion = (packageInfo) => {
|
|
|
482
482
|
const majorVersion = Number.parseFloat(packageInfo?.version || "");
|
|
483
483
|
return Number.isNaN(majorVersion) ? null : majorVersion;
|
|
484
484
|
};
|
|
485
|
+
var interopDefault = (module2) => module2 && typeof module2 === "object" && "default" in module2 ? module2.default : module2;
|
|
485
486
|
function getKeysOfTruthyValues(object, requireAtLeastOneTruthyValue) {
|
|
486
487
|
const result = (0, import_utils.objectEntries)(object).filter(([, value]) => value).map(([key]) => key);
|
|
487
488
|
if (requireAtLeastOneTruthyValue && result.length === 0) {
|
|
@@ -2431,7 +2432,7 @@ var reactEslintConfig = (options, internalOptions) => {
|
|
|
2431
2432
|
const isReactXPreferred = pluginX === "prefer" || pluginX === "only";
|
|
2432
2433
|
const getDoubleRuleName = (nameX, nameOriginal) => {
|
|
2433
2434
|
const nameXUnprefixed = nameX.match(/^(?:[^/]+\/)?(.*)$/)?.[1];
|
|
2434
|
-
const result = `${isReactXPreferred ? "@eslint-react/" : "react/"}${isReactXPreferred ?
|
|
2435
|
+
const result = `${isReactXPreferred ? "@eslint-react/" : "react/"}${isReactXPreferred ? nameX : nameOriginal ?? nameXUnprefixed}`;
|
|
2435
2436
|
return result;
|
|
2436
2437
|
};
|
|
2437
2438
|
const getDoubleRuleSeverity = (severity, isXRule) => isReactXPreferred && !isReactXEnabled || isReactPreferred && !isReactEnabled || !isReactXPreferred && isXRule === true || !isReactPreferred && isXRule === false ? OFF : severity;
|
|
@@ -2850,7 +2851,6 @@ var sonarEslintConfig = (options, internalOptions) => {
|
|
|
2850
2851
|
// src/configs/tailwind.ts
|
|
2851
2852
|
init_cjs_shims();
|
|
2852
2853
|
var import_utils12 = require("@antfu/utils");
|
|
2853
|
-
var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"), 1);
|
|
2854
2854
|
var DEFAULT_PLUGIN_SETTINGS = {
|
|
2855
2855
|
callees: ["classnames", "clsx", "ctl", "cva", "tv"],
|
|
2856
2856
|
ignoredKeys: ["compoundVariants", "defaultVariants"],
|
|
@@ -2879,7 +2879,7 @@ var tailwindEslintConfig = (options, internalOptions) => {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
2881
|
}
|
|
2882
|
-
}).
|
|
2882
|
+
}).addRule("classnames-order", WARNING).addRule("enforces-negative-arbitrary-values", WARNING).addRule("enforces-shorthand", WARNING).addRule("migration-from-tailwind-2", WARNING).addRule("no-arbitrary-value", OFF).addRule("no-contradicting-classname", ERROR).addRule("no-custom-classname", OFF).addRule("no-unnecessary-arbitrary-value", WARNING).addOverrides();
|
|
2883
2883
|
return builder.getAllConfigs();
|
|
2884
2884
|
};
|
|
2885
2885
|
|
|
@@ -3179,7 +3179,6 @@ var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-re
|
|
|
3179
3179
|
var eslintPluginRegexp2 = __toESM(require("eslint-plugin-regexp"), 1);
|
|
3180
3180
|
var import_eslint_plugin_security2 = __toESM(require("eslint-plugin-security"), 1);
|
|
3181
3181
|
var import_eslint_plugin_sonarjs2 = __toESM(require("eslint-plugin-sonarjs"), 1);
|
|
3182
|
-
var import_eslint_plugin_tailwindcss2 = __toESM(require("eslint-plugin-tailwindcss"), 1);
|
|
3183
3182
|
var import_eslint_plugin_toml2 = __toESM(require("eslint-plugin-toml"), 1);
|
|
3184
3183
|
var import_eslint_plugin_unicorn2 = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
3185
3184
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
@@ -3187,59 +3186,66 @@ var import_eslint_plugin_vue2 = __toESM(require("eslint-plugin-vue"), 1);
|
|
|
3187
3186
|
var import_eslint_plugin_vuejs_accessibility2 = __toESM(require("eslint-plugin-vuejs-accessibility"), 1);
|
|
3188
3187
|
var import_eslint_plugin_yml2 = __toESM(require("eslint-plugin-yml"), 1);
|
|
3189
3188
|
var import_typescript_eslint2 = require("typescript-eslint");
|
|
3190
|
-
var
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3189
|
+
var allEslintPlugins = async () => {
|
|
3190
|
+
const eslintPluginTailwind = await import("eslint-plugin-tailwindcss").then(interopDefault).catch((error) => {
|
|
3191
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ERR_PACKAGE_PATH_NOT_EXPORTED") {
|
|
3192
|
+
return null;
|
|
3193
|
+
}
|
|
3194
|
+
throw error;
|
|
3195
|
+
});
|
|
3196
|
+
return {
|
|
3197
|
+
unicorn: import_eslint_plugin_unicorn2.default,
|
|
3198
|
+
"@stylistic": import_eslint_plugin3.default,
|
|
3199
|
+
// @ts-expect-error types mismatch
|
|
3200
|
+
"@typescript-eslint": import_typescript_eslint2.plugin,
|
|
3201
|
+
// @ts-expect-error types mismatch
|
|
3202
|
+
"css-in-js": import_eslint_plugin_css.default,
|
|
3203
|
+
"@eslint-community/eslint-comments": import_eslint_plugin_eslint_comments2.default,
|
|
3204
|
+
// @ts-expect-error types mismatch
|
|
3205
|
+
import: import_eslint_plugin_import_x2.default,
|
|
3206
|
+
jest: import_eslint_plugin_jest2.default,
|
|
3207
|
+
"jest-extended": import_eslint_plugin_jest_extended2.default,
|
|
3208
|
+
"unused-imports": import_eslint_plugin_unused_imports.default,
|
|
3209
|
+
jsdoc: import_eslint_plugin_jsdoc2.default,
|
|
3210
|
+
// @ts-expect-error types mismatch
|
|
3211
|
+
jsonc: import_eslint_plugin_jsonc2.default,
|
|
3212
|
+
markdown: import_markdown2.default,
|
|
3213
|
+
node: import_eslint_plugin_n2.default,
|
|
3214
|
+
// @ts-expect-error types mismatch
|
|
3215
|
+
"package-json": import_eslint_plugin_package_json2.default,
|
|
3216
|
+
perfectionist: import_eslint_plugin_perfectionist.default,
|
|
3217
|
+
// @ts-expect-error types mismatch
|
|
3218
|
+
"prefer-arrow-functions": import_eslint_plugin_prefer_arrow_functions.default,
|
|
3219
|
+
promise: import_eslint_plugin_promise2.default,
|
|
3220
|
+
regexp: eslintPluginRegexp2,
|
|
3221
|
+
// @ts-expect-error types mismatch
|
|
3222
|
+
security: import_eslint_plugin_security2.default,
|
|
3223
|
+
sonarjs: import_eslint_plugin_sonarjs2.default,
|
|
3224
|
+
...eslintPluginTailwind && { tailwindcss: eslintPluginTailwind },
|
|
3225
|
+
// @ts-expect-error types mismatch
|
|
3226
|
+
toml: import_eslint_plugin_toml2.default,
|
|
3227
|
+
"no-type-assertion": import_eslint_plugin_no_type_assertion.default,
|
|
3228
|
+
vitest: import_eslint_plugin4.default,
|
|
3229
|
+
vue: import_eslint_plugin_vue2.default,
|
|
3230
|
+
"vuejs-accessibility": import_eslint_plugin_vuejs_accessibility2.default,
|
|
3231
|
+
// @ts-expect-error types mismatch
|
|
3232
|
+
pinia: import_eslint_plugin_pinia2.default,
|
|
3233
|
+
// @ts-expect-error types mismatch
|
|
3234
|
+
yml: import_eslint_plugin_yml2.default,
|
|
3235
|
+
"de-morgan": import_eslint_plugin_de_morgan.default,
|
|
3236
|
+
qwik: (0, import_compat.fixupPluginRules)(eslintPluginQwik2),
|
|
3237
|
+
// @ts-expect-error types mismatch
|
|
3238
|
+
"json-schema-validator": import_eslint_plugin_json_schema_validator.default,
|
|
3239
|
+
css: import_css2.default,
|
|
3240
|
+
react: import_eslint_plugin_react.default,
|
|
3241
|
+
"react-hooks": eslintPluginReactHooks,
|
|
3242
|
+
...import_eslint_plugin2.default.configs.all.plugins,
|
|
3243
|
+
"react-refresh": import_eslint_plugin_react_refresh.default,
|
|
3244
|
+
"react-compiler": eslintPluginReactCompiler,
|
|
3245
|
+
// @ts-expect-error types mismatch
|
|
3246
|
+
"jsx-a11y": import_eslint_plugin_jsx_a11y.default,
|
|
3247
|
+
pnpm: import_eslint_plugin_pnpm.default
|
|
3248
|
+
};
|
|
3243
3249
|
};
|
|
3244
3250
|
|
|
3245
3251
|
// src/index.ts
|
|
@@ -3258,6 +3264,10 @@ var eslintConfig = async (options = {}) => {
|
|
|
3258
3264
|
const isVueEnabled = configsOptions.vue !== false && (Boolean(configsOptions.vue) || (0, import_local_pkg6.isPackageExists)("vue"));
|
|
3259
3265
|
const typescriptPackageInfo = (0, import_local_pkg6.getPackageInfoSync)("typescript");
|
|
3260
3266
|
const isTypescriptEnabled = configsOptions.ts !== false && Boolean(configsOptions.ts || typescriptPackageInfo);
|
|
3267
|
+
const [usedPackageManager, allLoadedEslintPlugins] = await Promise.all([
|
|
3268
|
+
(0, import_detect.detect)(),
|
|
3269
|
+
allEslintPlugins()
|
|
3270
|
+
]);
|
|
3261
3271
|
const gitignoreConfig = typeof options.gitignore === "object" ? (0, import_eslint_config_flat_gitignore.default)(options.gitignore) : import_node_fs.default.existsSync(".gitignore") ? (0, import_eslint_config_flat_gitignore.default)() : null;
|
|
3262
3272
|
const jsOptions = {
|
|
3263
3273
|
...assignOptions(configsOptions, "js")
|
|
@@ -3304,7 +3314,10 @@ var eslintConfig = async (options = {}) => {
|
|
|
3304
3314
|
const sonarOptions = {
|
|
3305
3315
|
...assignOptions(configsOptions, "sonar")
|
|
3306
3316
|
};
|
|
3307
|
-
const
|
|
3317
|
+
const tailwindcssPackageInfo = (0, import_local_pkg6.getPackageInfoSync)("tailwindcss");
|
|
3318
|
+
const isTailwindEnabled = "tailwindcss" in allLoadedEslintPlugins && Boolean(
|
|
3319
|
+
configsOptions.tailwind ?? (tailwindcssPackageInfo != null && (getPackageMajorVersion(tailwindcssPackageInfo) ?? Number.POSITIVE_INFINITY) < 4)
|
|
3320
|
+
);
|
|
3308
3321
|
const tailwindOptions = {
|
|
3309
3322
|
...assignOptions(configsOptions, "tailwind")
|
|
3310
3323
|
};
|
|
@@ -3362,7 +3375,6 @@ var eslintConfig = async (options = {}) => {
|
|
|
3362
3375
|
const jsxA11yOptions = {
|
|
3363
3376
|
...assignOptions(configsOptions, "jsxA11y")
|
|
3364
3377
|
};
|
|
3365
|
-
const usedPackageManager = await (0, import_detect.detect)();
|
|
3366
3378
|
const isPnpmEnabled = Boolean(configsOptions.pnpm ?? usedPackageManager?.name === "pnpm");
|
|
3367
3379
|
const pnpmOptions = {
|
|
3368
3380
|
...assignOptions(configsOptions, "pnpm")
|
|
@@ -3419,7 +3431,7 @@ var eslintConfig = async (options = {}) => {
|
|
|
3419
3431
|
internalOptions
|
|
3420
3432
|
);
|
|
3421
3433
|
const allPlugins = {
|
|
3422
|
-
...
|
|
3434
|
+
...allLoadedEslintPlugins,
|
|
3423
3435
|
...angularPlugins
|
|
3424
3436
|
};
|
|
3425
3437
|
return [
|
package/dist/index.js
CHANGED
|
@@ -469,6 +469,7 @@ var getPackageSemverVersion = (packageInfo) => {
|
|
|
469
469
|
const majorVersion = Number.parseFloat(packageInfo?.version || "");
|
|
470
470
|
return Number.isNaN(majorVersion) ? null : majorVersion;
|
|
471
471
|
};
|
|
472
|
+
var interopDefault = (module) => module && typeof module === "object" && "default" in module ? module.default : module;
|
|
472
473
|
function getKeysOfTruthyValues(object, requireAtLeastOneTruthyValue) {
|
|
473
474
|
const result = objectEntriesUnsafe(object).filter(([, value]) => value).map(([key]) => key);
|
|
474
475
|
if (requireAtLeastOneTruthyValue && result.length === 0) {
|
|
@@ -2420,7 +2421,7 @@ var reactEslintConfig = (options, internalOptions) => {
|
|
|
2420
2421
|
const isReactXPreferred = pluginX === "prefer" || pluginX === "only";
|
|
2421
2422
|
const getDoubleRuleName = (nameX, nameOriginal) => {
|
|
2422
2423
|
const nameXUnprefixed = nameX.match(/^(?:[^/]+\/)?(.*)$/)?.[1];
|
|
2423
|
-
const result = `${isReactXPreferred ? "@eslint-react/" : "react/"}${isReactXPreferred ?
|
|
2424
|
+
const result = `${isReactXPreferred ? "@eslint-react/" : "react/"}${isReactXPreferred ? nameX : nameOriginal ?? nameXUnprefixed}`;
|
|
2424
2425
|
return result;
|
|
2425
2426
|
};
|
|
2426
2427
|
const getDoubleRuleSeverity = (severity, isXRule) => isReactXPreferred && !isReactXEnabled || isReactPreferred && !isReactEnabled || !isReactXPreferred && isXRule === true || !isReactPreferred && isXRule === false ? OFF : severity;
|
|
@@ -2839,7 +2840,6 @@ var sonarEslintConfig = (options, internalOptions) => {
|
|
|
2839
2840
|
// src/configs/tailwind.ts
|
|
2840
2841
|
init_esm_shims();
|
|
2841
2842
|
import { objectKeys as objectKeys2 } from "@antfu/utils";
|
|
2842
|
-
import eslintPluginTailwind from "eslint-plugin-tailwindcss";
|
|
2843
2843
|
var DEFAULT_PLUGIN_SETTINGS = {
|
|
2844
2844
|
callees: ["classnames", "clsx", "ctl", "cva", "tv"],
|
|
2845
2845
|
ignoredKeys: ["compoundVariants", "defaultVariants"],
|
|
@@ -2868,7 +2868,7 @@ var tailwindEslintConfig = (options, internalOptions) => {
|
|
|
2868
2868
|
}
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
|
-
}).
|
|
2871
|
+
}).addRule("classnames-order", WARNING).addRule("enforces-negative-arbitrary-values", WARNING).addRule("enforces-shorthand", WARNING).addRule("migration-from-tailwind-2", WARNING).addRule("no-arbitrary-value", OFF).addRule("no-contradicting-classname", ERROR).addRule("no-custom-classname", OFF).addRule("no-unnecessary-arbitrary-value", WARNING).addOverrides();
|
|
2872
2872
|
return builder.getAllConfigs();
|
|
2873
2873
|
};
|
|
2874
2874
|
|
|
@@ -3168,7 +3168,6 @@ import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
|
|
|
3168
3168
|
import * as eslintPluginRegexp2 from "eslint-plugin-regexp";
|
|
3169
3169
|
import eslintPluginSecurity2 from "eslint-plugin-security";
|
|
3170
3170
|
import eslintPluginSonar2 from "eslint-plugin-sonarjs";
|
|
3171
|
-
import eslintPluginTailwind2 from "eslint-plugin-tailwindcss";
|
|
3172
3171
|
import eslintPluginToml2 from "eslint-plugin-toml";
|
|
3173
3172
|
import eslintPluginUnicorn2 from "eslint-plugin-unicorn";
|
|
3174
3173
|
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
@@ -3176,59 +3175,66 @@ import eslintPluginVue2 from "eslint-plugin-vue";
|
|
|
3176
3175
|
import eslintPluginVueA11y2 from "eslint-plugin-vuejs-accessibility";
|
|
3177
3176
|
import eslintPluginYaml2 from "eslint-plugin-yml";
|
|
3178
3177
|
import { plugin as typescriptEslintPlugin } from "typescript-eslint";
|
|
3179
|
-
var
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3178
|
+
var allEslintPlugins = async () => {
|
|
3179
|
+
const eslintPluginTailwind = await import("eslint-plugin-tailwindcss").then(interopDefault).catch((error) => {
|
|
3180
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ERR_PACKAGE_PATH_NOT_EXPORTED") {
|
|
3181
|
+
return null;
|
|
3182
|
+
}
|
|
3183
|
+
throw error;
|
|
3184
|
+
});
|
|
3185
|
+
return {
|
|
3186
|
+
unicorn: eslintPluginUnicorn2,
|
|
3187
|
+
"@stylistic": eslintPluginStylistic,
|
|
3188
|
+
// @ts-expect-error types mismatch
|
|
3189
|
+
"@typescript-eslint": typescriptEslintPlugin,
|
|
3190
|
+
// @ts-expect-error types mismatch
|
|
3191
|
+
"css-in-js": eslintPluginCssInJs,
|
|
3192
|
+
"@eslint-community/eslint-comments": eslintPluginEslintComments2,
|
|
3193
|
+
// @ts-expect-error types mismatch
|
|
3194
|
+
import: eslintPluginImportX2,
|
|
3195
|
+
jest: eslintPluginJest2,
|
|
3196
|
+
"jest-extended": eslintPluginJestExtended2,
|
|
3197
|
+
"unused-imports": eslintPluginUnusedImports,
|
|
3198
|
+
jsdoc: eslintPluginJsDoc2,
|
|
3199
|
+
// @ts-expect-error types mismatch
|
|
3200
|
+
jsonc: eslintPluginJsonc2,
|
|
3201
|
+
markdown: eslintPluginMarkdown2,
|
|
3202
|
+
node: eslintPluginNode2,
|
|
3203
|
+
// @ts-expect-error types mismatch
|
|
3204
|
+
"package-json": eslintPluginPackageJson2,
|
|
3205
|
+
perfectionist: eslintPluginPerfectionist,
|
|
3206
|
+
// @ts-expect-error types mismatch
|
|
3207
|
+
"prefer-arrow-functions": eslintPluginPreferArrowFunctions,
|
|
3208
|
+
promise: eslintPluginPromise2,
|
|
3209
|
+
regexp: eslintPluginRegexp2,
|
|
3210
|
+
// @ts-expect-error types mismatch
|
|
3211
|
+
security: eslintPluginSecurity2,
|
|
3212
|
+
sonarjs: eslintPluginSonar2,
|
|
3213
|
+
...eslintPluginTailwind && { tailwindcss: eslintPluginTailwind },
|
|
3214
|
+
// @ts-expect-error types mismatch
|
|
3215
|
+
toml: eslintPluginToml2,
|
|
3216
|
+
"no-type-assertion": eslintPluginNoTypeAssertion,
|
|
3217
|
+
vitest: eslintPluginVitest2,
|
|
3218
|
+
vue: eslintPluginVue2,
|
|
3219
|
+
"vuejs-accessibility": eslintPluginVueA11y2,
|
|
3220
|
+
// @ts-expect-error types mismatch
|
|
3221
|
+
pinia: eslintPluginPinia2,
|
|
3222
|
+
// @ts-expect-error types mismatch
|
|
3223
|
+
yml: eslintPluginYaml2,
|
|
3224
|
+
"de-morgan": eslintPluginDeMorgan,
|
|
3225
|
+
qwik: fixupPluginRules(eslintPluginQwik2),
|
|
3226
|
+
// @ts-expect-error types mismatch
|
|
3227
|
+
"json-schema-validator": eslintPluginJsonSchemaValidator,
|
|
3228
|
+
css: eslintPluginCss2,
|
|
3229
|
+
react: eslintPluginReact,
|
|
3230
|
+
"react-hooks": eslintPluginReactHooks,
|
|
3231
|
+
...eslintPluginReactX.configs.all.plugins,
|
|
3232
|
+
"react-refresh": eslintPluginReactRefresh,
|
|
3233
|
+
"react-compiler": eslintPluginReactCompiler,
|
|
3234
|
+
// @ts-expect-error types mismatch
|
|
3235
|
+
"jsx-a11y": eslintPluginJsxA11y,
|
|
3236
|
+
pnpm: eslintPluginPnpm
|
|
3237
|
+
};
|
|
3232
3238
|
};
|
|
3233
3239
|
|
|
3234
3240
|
// src/index.ts
|
|
@@ -3247,6 +3253,10 @@ var eslintConfig = async (options = {}) => {
|
|
|
3247
3253
|
const isVueEnabled = configsOptions.vue !== false && (Boolean(configsOptions.vue) || isPackageExists4("vue"));
|
|
3248
3254
|
const typescriptPackageInfo = getPackageInfoSync4("typescript");
|
|
3249
3255
|
const isTypescriptEnabled = configsOptions.ts !== false && Boolean(configsOptions.ts || typescriptPackageInfo);
|
|
3256
|
+
const [usedPackageManager, allLoadedEslintPlugins] = await Promise.all([
|
|
3257
|
+
detectPackageManager(),
|
|
3258
|
+
allEslintPlugins()
|
|
3259
|
+
]);
|
|
3250
3260
|
const gitignoreConfig = typeof options.gitignore === "object" ? eslintGitignore(options.gitignore) : fs.existsSync(".gitignore") ? eslintGitignore() : null;
|
|
3251
3261
|
const jsOptions = {
|
|
3252
3262
|
...assignOptions(configsOptions, "js")
|
|
@@ -3293,7 +3303,10 @@ var eslintConfig = async (options = {}) => {
|
|
|
3293
3303
|
const sonarOptions = {
|
|
3294
3304
|
...assignOptions(configsOptions, "sonar")
|
|
3295
3305
|
};
|
|
3296
|
-
const
|
|
3306
|
+
const tailwindcssPackageInfo = getPackageInfoSync4("tailwindcss");
|
|
3307
|
+
const isTailwindEnabled = "tailwindcss" in allLoadedEslintPlugins && Boolean(
|
|
3308
|
+
configsOptions.tailwind ?? (tailwindcssPackageInfo != null && (getPackageMajorVersion(tailwindcssPackageInfo) ?? Number.POSITIVE_INFINITY) < 4)
|
|
3309
|
+
);
|
|
3297
3310
|
const tailwindOptions = {
|
|
3298
3311
|
...assignOptions(configsOptions, "tailwind")
|
|
3299
3312
|
};
|
|
@@ -3351,7 +3364,6 @@ var eslintConfig = async (options = {}) => {
|
|
|
3351
3364
|
const jsxA11yOptions = {
|
|
3352
3365
|
...assignOptions(configsOptions, "jsxA11y")
|
|
3353
3366
|
};
|
|
3354
|
-
const usedPackageManager = await detectPackageManager();
|
|
3355
3367
|
const isPnpmEnabled = Boolean(configsOptions.pnpm ?? usedPackageManager?.name === "pnpm");
|
|
3356
3368
|
const pnpmOptions = {
|
|
3357
3369
|
...assignOptions(configsOptions, "pnpm")
|
|
@@ -3408,7 +3420,7 @@ var eslintConfig = async (options = {}) => {
|
|
|
3408
3420
|
internalOptions
|
|
3409
3421
|
);
|
|
3410
3422
|
const allPlugins = {
|
|
3411
|
-
...
|
|
3423
|
+
...allLoadedEslintPlugins,
|
|
3412
3424
|
...angularPlugins
|
|
3413
3425
|
};
|
|
3414
3426
|
return [
|