diff --git a/jest.config.js b/jest.config.js index af9f1332..49986b7f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,12 +2,7 @@ module.exports = { watchman: false, moduleFileExtensions: ['ts', 'js', 'json'], transform: { - '^.+\\.(ts)$': 'ts-jest', + '^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }], }, testPathIgnorePatterns: ['dist'], - globals: { - 'ts-jest': { - tsconfig: 'tsconfig.json', - }, - }, } diff --git a/package.json b/package.json index 968b7ce9..d32d4665 100644 --- a/package.json +++ b/package.json @@ -35,14 +35,15 @@ "@types/jest": "^29.2.4", "@types/json-diff": "^0.9.1", "@typescript-eslint/eslint-plugin": "^5.46.0", - "@valora/eslint-config-typescript": "^0.0.1", + "@valora/eslint-config-typescript": "^1.0.1", "@valora/prettier-config": "^0.0.1", "eslint": "^8.29.0", "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jest": "^27.1.6", "eslint-plugin-react": "^7.31.11", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0", - "husky": "^7.0.4", + "husky": "^8.0.2", "image-size": "^1.0.2", "jest": "^29.3.1", "prettier": "^2.8.1", diff --git a/src/assets.test.ts b/src/assets.test.ts index f4eb99cf..724797d2 100644 --- a/src/assets.test.ts +++ b/src/assets.test.ts @@ -42,8 +42,10 @@ describe('assets', () => { const { height, width } = await sizeOfImage(assetPath) if (ASSETS_SIZE_EXCEPTIONS.has(path.basename(assetPath))) { // Just check it's a square + /* eslint-disable jest/no-conditional-expect */ expect(height).toBeGreaterThan(0) expect(height).toBe(width) + /* eslint-enable jest/no-conditional-expect */ return } expect(height).toBe(REQUIRED_ASSET_HEIGHT) @@ -67,7 +69,8 @@ describe('assets', () => { .map((assetFilename) => path.join(ASSETS_DIRECTORY, assetFilename)) // TODO: update assets so they can pass these requirements - xit.each(assetPaths)('%s is the required size', async (assetPath) => { + // eslint-disable-next-line jest/no-disabled-tests + it.skip.each(assetPaths)('%s is the required size', async (assetPath) => { const { height, width } = await sizeOfImage(assetPath) expect(height).toBe(REQUIRED_ASSET_HEIGHT) expect(width).toBe(REQUIRED_ASSET_WIDTH) diff --git a/src/schemas.test.ts b/src/schemas.test.ts index d2762c38..49a73734 100644 --- a/src/schemas.test.ts +++ b/src/schemas.test.ts @@ -2,6 +2,7 @@ import allMetadata from './data/' describe('Schema validation', () => { Object.entries(allMetadata).forEach(([project, projectMetadata]) => { + // eslint-disable-next-line jest/valid-title describe(project, () => { it.each(projectMetadata)('$rtdbLocation', ({ data, schema }) => { const validationResult = schema.validate(data, { diff --git a/yarn.lock b/yarn.lock index 61f7fe2a..4ad04897 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1136,6 +1136,14 @@ "@typescript-eslint/types" "5.46.0" "@typescript-eslint/visitor-keys" "5.46.0" +"@typescript-eslint/scope-manager@5.46.1": + version "5.46.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.46.1.tgz#70af8425c79bbc1178b5a63fb51102ddf48e104a" + integrity sha512-iOChVivo4jpwUdrJZyXSMrEIM/PvsbbDOX1y3UCKjSgWn+W89skxWaYXACQfxmIGhPVpRWK/VWPYc+bad6smIA== + dependencies: + "@typescript-eslint/types" "5.46.1" + "@typescript-eslint/visitor-keys" "5.46.1" + "@typescript-eslint/type-utils@5.46.0": version "5.46.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz#3a4507b3b437e2fd9e95c3e5eea5ae16f79d64b3" @@ -1156,6 +1164,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.46.0.tgz#f4d76622a996b88153bbd829ea9ccb9f7a5d28bc" integrity sha512-wHWgQHFB+qh6bu0IAPAJCdeCdI0wwzZnnWThlmHNY01XJ9Z97oKqKOzWYpR2I83QmshhQJl6LDM9TqMiMwJBTw== +"@typescript-eslint/types@5.46.1": + version "5.46.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.46.1.tgz#4e9db2107b9a88441c4d5ecacde3bb7a5ebbd47e" + integrity sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w== + "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" @@ -1182,6 +1195,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.46.1": + version "5.46.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.46.1.tgz#5358088f98a8f9939355e0996f9c8f41c25eced2" + integrity sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg== + dependencies: + "@typescript-eslint/types" "5.46.1" + "@typescript-eslint/visitor-keys" "5.46.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.46.0": version "5.46.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.46.0.tgz#600cd873ba471b7d8b0b9f35de34cf852c6fcb31" @@ -1196,6 +1222,20 @@ eslint-utils "^3.0.0" semver "^7.3.7" +"@typescript-eslint/utils@^5.10.0": + version "5.46.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.46.1.tgz#7da3c934d9fd0eb4002a6bb3429f33298b469b4a" + integrity sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.46.1" + "@typescript-eslint/types" "5.46.1" + "@typescript-eslint/typescript-estree" "5.46.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + "@typescript-eslint/visitor-keys@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" @@ -1212,10 +1252,18 @@ "@typescript-eslint/types" "5.46.0" eslint-visitor-keys "^3.3.0" -"@valora/eslint-config-typescript@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@valora/eslint-config-typescript/-/eslint-config-typescript-0.0.1.tgz#467458e748185f665267da09e627fd50627be760" - integrity sha512-htzTwQNlgcyeat8t/Mq4F9DFBSeCKPzwRJ6NrDhKxDmd8dV7rggJXjBlCBqhovoVtxtKUn/zX1KKP1Fkh6vhwg== +"@typescript-eslint/visitor-keys@5.46.1": + version "5.46.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.46.1.tgz#126cc6fe3c0f83608b2b125c5d9daced61394242" + integrity sha512-jczZ9noovXwy59KjRTk1OftT78pwygdcmCuBf8yMoWt/8O8l+6x2LSEze0E4TeepXK4MezW3zGSyoDRZK7Y9cg== + dependencies: + "@typescript-eslint/types" "5.46.1" + eslint-visitor-keys "^3.3.0" + +"@valora/eslint-config-typescript@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@valora/eslint-config-typescript/-/eslint-config-typescript-1.0.1.tgz#99524730423f1cd125a94ee50539e3aa3d4b9e7c" + integrity sha512-8sF+XoEB/tQXpy5M94Je+R+aL1DGFyGHD/Fn1hz4ZbGvG4gaQnrWa9fsAeQbSqF/Rn93RZKJeEgLQysuIU1wxg== dependencies: "@typescript-eslint/parser" "^4.25.0" @@ -1985,6 +2033,13 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" +eslint-plugin-jest@^27.1.6: + version "27.1.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.6.tgz#361d943f07d1978838e6b852c44a579f3879e332" + integrity sha512-XA7RFLSrlQF9IGtAmhddkUkBuICCTuryfOTfCSWcZHiHb69OilIH05oozH2XA6CEOtztnOd0vgXyvxZodkxGjg== + dependencies: + "@typescript-eslint/utils" "^5.10.0" + eslint-plugin-react-hooks@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" @@ -2603,10 +2658,10 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -husky@^7.0.4: - version "7.0.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" - integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== +husky@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.2.tgz#5816a60db02650f1f22c8b69b928fd6bcd77a236" + integrity sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg== ignore@^5.2.0: version "5.2.0"