Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/config/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,6 @@ module.exports.groups = [
},
{
type: 'Scroll Margin',
members: 'scroll\\-(?<value>${scrollMargin})',
configKey: 'scrollMargin',
members: [
{
Expand Down Expand Up @@ -1454,7 +1453,6 @@ module.exports.groups = [
},
{
type: 'Scroll Padding',
members: 'scroll\\-(?<value>${scrollPadding})',
configKey: 'scrollPadding',
members: [
{
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/enforces-shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions lib/rules/no-custom-classname.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 0 additions & 3 deletions lib/util/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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':
Expand Down
9 changes: 4 additions & 5 deletions lib/util/groupMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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})`);
Expand Down Expand Up @@ -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;
}

Expand Down