2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-06 23:23:58 +00:00

lint: change to prettier on local

This commit is contained in:
Joaquín Sánchez Jiménez 2022-03-14 15:39:40 +01:00
parent 08d35b55f7
commit 84e9b9f277
6 changed files with 20 additions and 18 deletions

View File

@ -14,7 +14,7 @@
},
"scripts": {
"clean": "rimraf lib tests-compiled tsconfig.tsbuildinfo",
"lint": "eslint src/**/*.ts",
"lint": "eslint --fix src/**/*.ts",
"prebuild": "npm run lint && npm run clean",
"build": "node build",
"build-dual": "unbuild",

View File

@ -4,19 +4,14 @@ const fixturesDir = './tests/fixtures';
describe('Testing FileSystemIconLoader', () => {
test('FileSystemIconLoader', async () => {
const result = await FileSystemIconLoader(fixturesDir)(
'circle'
);
const result = await FileSystemIconLoader(fixturesDir)('circle');
expect(result && result.indexOf('svg') > -1).toBeTruthy();
});
test('FileSystemIconLoader with transform', async () => {
const result = await FileSystemIconLoader(
fixturesDir,
(icon) => {
return icon.replace('<svg ', '<svg width="1em" height="1em" ');
}
)('circle');
const result = await FileSystemIconLoader(fixturesDir, (icon) => {
return icon.replace('<svg ', '<svg width="1em" height="1em" ');
})('circle');
expect(result && result.indexOf('width="1em"') > -1).toBeTruthy();
expect(result && result.indexOf('height="1em"') > -1).toBeTruthy();
});

View File

@ -7,7 +7,9 @@ describe('Testing loadIcon with @iconify-json/flat-color-icons>', () => {
});
test('loadIcon adds xmlns:xlink', async () => {
const result = await loadNodeIcon('flat-color-icons', 'up-right', { addXmlNs: true });
const result = await loadNodeIcon('flat-color-icons', 'up-right', {
addXmlNs: true,
});
expect(result).toBeTruthy();
expect(result && result.indexOf('xmlns:xlink=') > -1).toBeTruthy();
});

View File

@ -24,11 +24,15 @@ describe('Testing loadIcon', () => {
});
test('CustomCollection using dynamic import', async () => {
// @ts-ignore
const result = await loadIcon('flat-color-icons', 'up-right', {
customCollections: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
'flat-color-icons': () => import('@iconify-json/flat-color-icons/icons.json').then(i => i?.default),
'flat-color-icons': () =>
import(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
'@iconify-json/flat-color-icons/icons.json'
).then((i) => i?.default),
},
});
expect(result).toBeTruthy();

View File

@ -3,6 +3,6 @@
"compilerOptions": {
"types": ["node", "jest"],
"rootDir": ".",
"outDir": "../tests-compiled"
}
"outDir": "../tests-compiled",
}
}

View File

@ -13,7 +13,8 @@
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "error"
},
"importsNotUsedAsValues": "error",
"resolveJsonModule": true
},
"include": ["src/**/*.ts"]
}