From 84e9b9f277da6c95522f91061177e8ad36c2ddc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez=20Jim=C3=A9nez?= Date: Mon, 14 Mar 2022 15:39:40 +0100 Subject: [PATCH] lint: change to prettier on local --- packages/utils/package.json | 2 +- packages/utils/tests/file-system-icon-test.ts | 13 ++++--------- packages/utils/tests/iconify-icon-test.ts | 4 +++- packages/utils/tests/load-icon-test.ts | 10 +++++++--- packages/utils/tests/tsconfig.json | 4 ++-- packages/utils/tsconfig.json | 5 +++-- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/utils/package.json b/packages/utils/package.json index ee0ea19..0347621 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -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", diff --git a/packages/utils/tests/file-system-icon-test.ts b/packages/utils/tests/file-system-icon-test.ts index 5858970..f7e80df 100644 --- a/packages/utils/tests/file-system-icon-test.ts +++ b/packages/utils/tests/file-system-icon-test.ts @@ -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(' { + return icon.replace(' -1).toBeTruthy(); expect(result && result.indexOf('height="1em"') > -1).toBeTruthy(); }); diff --git a/packages/utils/tests/iconify-icon-test.ts b/packages/utils/tests/iconify-icon-test.ts index d0624a2..2153802 100644 --- a/packages/utils/tests/iconify-icon-test.ts +++ b/packages/utils/tests/iconify-icon-test.ts @@ -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(); }); diff --git a/packages/utils/tests/load-icon-test.ts b/packages/utils/tests/load-icon-test.ts index 6388a1d..aee7a70 100644 --- a/packages/utils/tests/load-icon-test.ts +++ b/packages/utils/tests/load-icon-test.ts @@ -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(); diff --git a/packages/utils/tests/tsconfig.json b/packages/utils/tests/tsconfig.json index f511b6b..c9048e0 100644 --- a/packages/utils/tests/tsconfig.json +++ b/packages/utils/tests/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "types": ["node", "jest"], "rootDir": ".", - "outDir": "../tests-compiled" - } + "outDir": "../tests-compiled", + } } diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index c25008c..9883bcd 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -13,7 +13,8 @@ "moduleResolution": "node", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error" - }, + "importsNotUsedAsValues": "error", + "resolveJsonModule": true + }, "include": ["src/**/*.ts"] }