mirror of
https://github.com/iconify/iconify.git
synced 2025-01-09 00:10:47 +00:00
lint: change to prettier on local
This commit is contained in:
parent
08d35b55f7
commit
84e9b9f277
@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf lib tests-compiled tsconfig.tsbuildinfo",
|
"clean": "rimraf lib tests-compiled tsconfig.tsbuildinfo",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint --fix src/**/*.ts",
|
||||||
"prebuild": "npm run lint && npm run clean",
|
"prebuild": "npm run lint && npm run clean",
|
||||||
"build": "node build",
|
"build": "node build",
|
||||||
"build-dual": "unbuild",
|
"build-dual": "unbuild",
|
||||||
|
@ -4,19 +4,14 @@ const fixturesDir = './tests/fixtures';
|
|||||||
|
|
||||||
describe('Testing FileSystemIconLoader', () => {
|
describe('Testing FileSystemIconLoader', () => {
|
||||||
test('FileSystemIconLoader', async () => {
|
test('FileSystemIconLoader', async () => {
|
||||||
const result = await FileSystemIconLoader(fixturesDir)(
|
const result = await FileSystemIconLoader(fixturesDir)('circle');
|
||||||
'circle'
|
|
||||||
);
|
|
||||||
expect(result && result.indexOf('svg') > -1).toBeTruthy();
|
expect(result && result.indexOf('svg') > -1).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('FileSystemIconLoader with transform', async () => {
|
test('FileSystemIconLoader with transform', async () => {
|
||||||
const result = await FileSystemIconLoader(
|
const result = await FileSystemIconLoader(fixturesDir, (icon) => {
|
||||||
fixturesDir,
|
|
||||||
(icon) => {
|
|
||||||
return icon.replace('<svg ', '<svg width="1em" height="1em" ');
|
return icon.replace('<svg ', '<svg width="1em" height="1em" ');
|
||||||
}
|
})('circle');
|
||||||
)('circle');
|
|
||||||
expect(result && result.indexOf('width="1em"') > -1).toBeTruthy();
|
expect(result && result.indexOf('width="1em"') > -1).toBeTruthy();
|
||||||
expect(result && result.indexOf('height="1em"') > -1).toBeTruthy();
|
expect(result && result.indexOf('height="1em"') > -1).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,9 @@ describe('Testing loadIcon with @iconify-json/flat-color-icons>', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('loadIcon adds xmlns:xlink', async () => {
|
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).toBeTruthy();
|
||||||
expect(result && result.indexOf('xmlns:xlink=') > -1).toBeTruthy();
|
expect(result && result.indexOf('xmlns:xlink=') > -1).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -24,11 +24,15 @@ describe('Testing loadIcon', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('CustomCollection using dynamic import', async () => {
|
test('CustomCollection using dynamic import', async () => {
|
||||||
|
// @ts-ignore
|
||||||
const result = await loadIcon('flat-color-icons', 'up-right', {
|
const result = await loadIcon('flat-color-icons', 'up-right', {
|
||||||
customCollections: {
|
customCollections: {
|
||||||
|
'flat-color-icons': () =>
|
||||||
|
import(
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
'flat-color-icons': () => import('@iconify-json/flat-color-icons/icons.json').then(i => i?.default),
|
'@iconify-json/flat-color-icons/icons.json'
|
||||||
|
).then((i) => i?.default),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["node", "jest"],
|
"types": ["node", "jest"],
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"outDir": "../tests-compiled"
|
"outDir": "../tests-compiled",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"importsNotUsedAsValues": "error"
|
"importsNotUsedAsValues": "error",
|
||||||
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts"]
|
"include": ["src/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user