diff --git a/lib/config/groups.js b/lib/config/groups.js index 8ab91d5..79ac21a 100644 --- a/lib/config/groups.js +++ b/lib/config/groups.js @@ -1412,7 +1412,6 @@ module.exports.groups = [ }, { type: 'Scroll Margin', - members: 'scroll\\-(?${scrollMargin})', configKey: 'scrollMargin', members: [ { @@ -1454,7 +1453,6 @@ module.exports.groups = [ }, { type: 'Scroll Padding', - members: 'scroll\\-(?${scrollPadding})', configKey: 'scrollPadding', members: [ { diff --git a/lib/rules/enforces-shorthand.js b/lib/rules/enforces-shorthand.js index ebe2f19..2f8eda3 100644 --- a/lib/rules/enforces-shorthand.js +++ b/lib/rules/enforces-shorthand.js @@ -341,7 +341,7 @@ module.exports = { // Handle sets of classnames with the same parent type // Each group parentType const checkedGroups = []; - remaining.forEach((classname, idx, arr) => { + remaining.forEach((classname) => { // Valid candidate if (classname.parentType === '') { validated.push(classname); @@ -412,7 +412,7 @@ module.exports = { troubles.push([toBeReplaced, patchedName]); let replaced = false; - sameVariantAndValue.forEach((ref, i) => { + sameVariantAndValue.forEach((ref) => { if (toBeKept.find((k) => k.name === ref.name)) { validated.push(ref); } else if (!replaced) { @@ -441,7 +441,7 @@ module.exports = { troubles.push([toBeReplaced, patchedName]); let replaced = false; - sameVariantAndValue.forEach((ref, i) => { + sameVariantAndValue.forEach((ref) => { if (toBeKept.find((k) => k.name === ref.name)) { validated.push(ref); } else if (!replaced) { diff --git a/lib/rules/no-custom-classname.js b/lib/rules/no-custom-classname.js index ca4e5da..d145b2c 100644 --- a/lib/rules/no-custom-classname.js +++ b/lib/rules/no-custom-classname.js @@ -28,8 +28,6 @@ const CUSTOM_CLASSNAME_DETECTED_MSG = `Classname '{{classname}}' is not a Tailwi const getGroupNameRegex = (prefix = '') => new RegExp(`^${escapeRegex(prefix)}(group|peer)\/[\\w\\$\\#\\@\\%\\^\\&\\*\\_\\-]+$`, 'i'); -const contextFallbackCache = new WeakMap(); - module.exports = { meta: { docs: { diff --git a/lib/util/ast.js b/lib/util/ast.js index a6ed24d..51228ea 100644 --- a/lib/util/ast.js +++ b/lib/util/ast.js @@ -59,7 +59,6 @@ function isClassAttribute(node, classRegex) { */ function isVueClassAttribute(node, classRegex) { const re = new RegExp(classRegex); - let name = ''; switch (true) { case node.key && node.key.name && re.test(node.key.name): // class="vue-classes-as-litteral" @@ -275,7 +274,6 @@ function parseNodeRecursive(rootNode, childNode, cb, skipConditional = false, is return; } else { const forceIsolation = skipConditional ? true : isolate; - let trim = false; switch (childNode.type) { case 'TemplateLiteral': childNode.expressions.forEach((exp) => { @@ -325,7 +323,6 @@ function parseNodeRecursive(rootNode, childNode, cb, skipConditional = false, is parseNodeRecursive(rootNode, childNode.key, cb, skipConditional, forceIsolation, ignoredKeys); return; case 'Literal': - trim = true; originalClassNamesValue = childNode.value; break; case 'TemplateElement': diff --git a/lib/util/groupMethods.js b/lib/util/groupMethods.js index be0b549..c1fe3c7 100644 --- a/lib/util/groupMethods.js +++ b/lib/util/groupMethods.js @@ -50,10 +50,9 @@ function generateOptionalOpacitySuffix(config) { * @param {String} propName The name of the prop e.g. textColor * @param {Array} keys Keys to be injected in the options * @param {Object} config Tailwind CSS Config - * @param {Boolean} isNegative If the value is negative * @returns {String} Generated part of regex exposing the possible values */ -function generateOptions(propName, keys, config, isNegative = false) { +function generateOptions(propName, keys, config) { const opacitySuffixes = generateOptionalOpacitySuffix(config); const genericArbitraryOption = '\\[(.*)\\]'; const defaultKeyIndex = keys.findIndex((v) => v === 'DEFAULT'); @@ -319,7 +318,7 @@ function patchRegex(re, config) { const absoluteProp = isNegative ? prop.substr(1) : prop; if (prop === 'dark') { // Special case, not a default property from the theme - replaced = replaced.replace(token, generateOptions(absoluteProp, [], config, isNegative)); + replaced = replaced.replace(token, generateOptions(absoluteProp, [], config)); return `${patched}(${replaced})`; } else if (prop === 'arbitraryProperties') { // Special case @@ -366,7 +365,7 @@ function patchRegex(re, config) { // empty array return; } - const opts = generateOptions(absoluteProp, keys, config, isNegative); + const opts = generateOptions(absoluteProp, keys, config); replaced = replaced.replace(token, opts); }); return (cache[re] = `${patched}(${replaced})`); @@ -410,7 +409,7 @@ function getGroups(groupsConfig, twConfig = null) { */ function initGroupSlots(groups) { const slots = []; - groups.forEach((g) => slots.push([])); + groups.forEach(() => slots.push([])); return slots; }