eslint-plugin-better-tailwindcss
Version:
auto-wraps tailwind classes after a certain print width or class count into multiple lines to improve readability.
27 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommonOptions = getCommonOptions;
const default_options_js_1 = require("../options/default-options.js");
const matchers_js_1 = require("./matchers.js");
function getCommonOptions(ctx) {
const attributes = getOption(ctx, "attributes") ?? default_options_js_1.DEFAULT_ATTRIBUTE_NAMES;
const callees = getOption(ctx, "callees") ?? default_options_js_1.DEFAULT_CALLEE_NAMES;
const variables = getOption(ctx, "variables") ?? default_options_js_1.DEFAULT_VARIABLE_NAMES;
const tags = getOption(ctx, "tags") ?? default_options_js_1.DEFAULT_TAG_NAMES;
const tailwindConfig = getOption(ctx, "entryPoint") ?? getOption(ctx, "tailwindConfig");
if ((0, matchers_js_1.isAttributesRegex)(attributes) || (0, matchers_js_1.isCalleeRegex)(callees) || (0, matchers_js_1.isVariableRegex)(variables)) {
console.warn("⚠️ Warning: Regex matching is deprecated and will be removed in the next major version. Please use matchers instead.");
}
return {
attributes,
callees,
tags,
tailwindConfig,
variables
};
}
function getOption(ctx, key) {
return ctx.options[0]?.[key] ?? ctx.settings["eslint-plugin-better-tailwindcss"]?.[key] ??
ctx.settings["better-tailwindcss"]?.[key];
}
//# sourceMappingURL=options.js.map