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
|
// Get function and values
|
||||||
const func = (parts[0] as string).trim();
|
const func = parts[0].trim();
|
||||||
const content = (parts[1] as string).trim();
|
const content = parts[1].trim();
|
||||||
|
|
||||||
// Get alpha and split content
|
// Get alpha and split content
|
||||||
let values: string[];
|
let values: string[];
|
||||||
@ -133,7 +133,7 @@ function fromFunction(value: string): Color | null {
|
|||||||
const isPercentage: boolean[] = [];
|
const isPercentage: boolean[] = [];
|
||||||
const numbers: number[] = [];
|
const numbers: number[] = [];
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
const colorStr = values[i] as string;
|
const colorStr = values[i];
|
||||||
const index = colorStr.indexOf('%');
|
const index = colorStr.indexOf('%');
|
||||||
const hasPercentage = index !== -1;
|
const hasPercentage = index !== -1;
|
||||||
if (hasPercentage && index !== colorStr.length - 1) {
|
if (hasPercentage && index !== colorStr.length - 1) {
|
||||||
|
@ -88,9 +88,9 @@ export function convertIconSetInfo(
|
|||||||
// Get name
|
// Get name
|
||||||
let name: string;
|
let name: string;
|
||||||
if (typeof source.name === 'string') {
|
if (typeof source.name === 'string') {
|
||||||
name = source.name as string;
|
name = source.name;
|
||||||
} else if (typeof source.title === 'string') {
|
} else if (typeof source.title === 'string') {
|
||||||
name = source.title as string;
|
name = source.title;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ export function validateIconSet(
|
|||||||
if (typeof data.chars === 'object') {
|
if (typeof data.chars === 'object') {
|
||||||
const chars = data.chars;
|
const chars = data.chars;
|
||||||
Object.keys(chars).forEach((char) => {
|
Object.keys(chars).forEach((char) => {
|
||||||
if (!char.match(matchChar) || typeof chars[char] !== 'string') {
|
if (!matchChar.exec(char) || typeof chars[char] !== 'string') {
|
||||||
if (fix) {
|
if (fix) {
|
||||||
delete chars[char];
|
delete chars[char];
|
||||||
return;
|
return;
|
||||||
|
@ -33,7 +33,7 @@ export function calculateSize(
|
|||||||
|
|
||||||
const newParts = [];
|
const newParts = [];
|
||||||
let code = oldParts.shift() as string;
|
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
|
// eslint-disable-next-line no-constant-condition
|
||||||
while (true) {
|
while (true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user