Skip to content

Commit

Permalink
refactor: use biome instead of eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jul 3, 2024
1 parent c03eb25 commit 43f4521
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 2,664 deletions.
16 changes: 16 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "off",
"useTemplate": "off"
}
}
}
}
13 changes: 8 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function expandMatcher(matcher) {
}

if (className) {
attributes.class = new RegExp(getCombinations(className.split(".")).map(function(order) {
attributes.class = new RegExp(getCombinations(className.split(".")).map((order) => {
return "(?:^|\\s)" + order.join("\\s(?:.*?\\s)?") + "(?:\\s|$)";
}).join("|"));
}
Expand Down Expand Up @@ -88,7 +88,10 @@ function expandAttributes(attrs) {
attrs = attrs.split("][");
const attrObject = {};
let l = attrs.length;
let attrMatch, name, operator, value;
let attrMatch;
let name;
let operator;
let value;

while (l--) {
attrMatch = attrs[l].match(attributeReg);
Expand All @@ -114,17 +117,17 @@ function getCombinations(values, subresult) {
subresult = subresult || [];
let result = [];

values.forEach(function (value) {
for (const value of values) {
if (subresult.indexOf(value) < 0) {
var _subresult = subresult.concat([value]);
const _subresult = subresult.concat([value]);

if (_subresult.length < values.length) {
result = result.concat(getCombinations(values, _subresult));
} else {
result.push(_subresult);
}
}
});
}

return result;
}
Expand Down
Loading

0 comments on commit 43f4521

Please sign in to comment.