mirror of
https://github.com/iconify/iconify.git
synced 2024-12-13 14:13:06 +00:00
chore: eslint --fix after enabling ts typed rules.
This commit is contained in:
parent
ff261a0216
commit
e5e4ddf49e
@ -60,8 +60,8 @@ function fromFunction(value: string): Color | null {
|
||||
}
|
||||
|
||||
// Get function and values
|
||||
const func = (parts[0] as string).trim();
|
||||
const content = (parts[1] as string).trim();
|
||||
const func = parts[0].trim();
|
||||
const content = parts[1].trim();
|
||||
|
||||
// Get alpha and split content
|
||||
let values: string[];
|
||||
@ -133,7 +133,7 @@ function fromFunction(value: string): Color | null {
|
||||
const isPercentage: boolean[] = [];
|
||||
const numbers: number[] = [];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const colorStr = values[i] as string;
|
||||
const colorStr = values[i];
|
||||
const index = colorStr.indexOf('%');
|
||||
const hasPercentage = index !== -1;
|
||||
if (hasPercentage && index !== colorStr.length - 1) {
|
||||
|
@ -88,9 +88,9 @@ export function convertIconSetInfo(
|
||||
// Get name
|
||||
let name: string;
|
||||
if (typeof source.name === 'string') {
|
||||
name = source.name as string;
|
||||
name = source.name;
|
||||
} else if (typeof source.title === 'string') {
|
||||
name = source.title as string;
|
||||
name = source.title;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ export function validateIconSet(
|
||||
if (typeof data.chars === 'object') {
|
||||
const chars = data.chars;
|
||||
Object.keys(chars).forEach((char) => {
|
||||
if (!char.match(matchChar) || typeof chars[char] !== 'string') {
|
||||
if (!matchChar.exec(char) || typeof chars[char] !== 'string') {
|
||||
if (fix) {
|
||||
delete chars[char];
|
||||
return;
|
||||
|
@ -33,7 +33,7 @@ export function calculateSize(
|
||||
|
||||
const newParts = [];
|
||||
let code = oldParts.shift() as string;
|
||||
let isNumber = unitsTest.test(code as string);
|
||||
let isNumber = unitsTest.test(code);
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
|
Loading…
Reference in New Issue
Block a user