diff --git a/.eslintrc.json b/.eslintrc.json index 43f7cf6..dd06949 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,6 +9,10 @@ { "files": "**/*.ts?(x)", "extends": "@faergeek/eslint-config/typescript" + }, + { + "files": "**/*.spec.ts?(x)", + "extends": "@faergeek/eslint-config/vitest" } ] } diff --git a/package.json b/package.json index e0d2189..5fabf89 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "devDependencies": { "@commitlint/cli": "^19.0.0", "@commitlint/config-conventional": "^19.0.0", - "@faergeek/eslint-config": "^6.0.0", + "@faergeek/eslint-config": "^6.1.0", "@types/node": "^20.11.16", "eslint": "^8.56.0", "prettier": "^3.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60455c2..7a77a7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^19.0.0 version: 19.2.2 '@faergeek/eslint-config': - specifier: ^6.0.0 - version: 6.0.24(eslint@8.57.0)(typescript@5.4.5) + specifier: ^6.1.0 + version: 6.1.0(eslint@8.57.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.2)) '@types/node': specifier: ^20.11.16 version: 20.14.2 @@ -282,8 +282,8 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@faergeek/eslint-config@6.0.24': - resolution: {integrity: sha512-RqnXHH+U/mXKApvZ+J2bQ3a+RbPaadmhSFP8NXKh6SpICWI2ljPRPtC40gvBl6zwjRtqebjAVMEgoafg7ajF4g==} + '@faergeek/eslint-config@6.1.0': + resolution: {integrity: sha512-O1UX5KLLmL59NNvYOXuIEHLD7Zc/ZD283KUP8PbX2jn2ujGVYNUU9ybp05mfnkLmhvFn6nCcQ4VJenPLb5IY8Q==} peerDependencies: eslint: ^8.56.0 @@ -1045,6 +1045,19 @@ packages: peerDependencies: eslint: '>=5.0.0' + eslint-plugin-vitest@0.5.4: + resolution: {integrity: sha512-um+odCkccAHU53WdKAw39MY61+1x990uXjSPguUCq3VcEHdqJrOb8OTMrbYlY6f9jAKx7x98kLVlIe3RJeJqoQ==} + engines: {node: ^18.0.0 || >= 20.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: ^8.57.0 || ^9.0.0 + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + vitest: + optional: true + eslint-scope@7.2.2: resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2843,7 +2856,7 @@ snapshots: '@eslint/js@8.57.0': {} - '@faergeek/eslint-config@6.0.24(eslint@8.57.0)(typescript@5.4.5)': + '@faergeek/eslint-config@6.1.0(eslint@8.57.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.2))': dependencies: '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/parser': 7.13.0(eslint@8.57.0)(typescript@5.4.5) @@ -2852,9 +2865,11 @@ snapshots: eslint-plugin-react: 7.34.2(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) eslint-plugin-simple-import-sort: 12.1.0(eslint@8.57.0) + eslint-plugin-vitest: 0.5.4(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.2)) transitivePeerDependencies: - supports-color - typescript + - vitest '@humanwhocodes/config-array@0.11.14': dependencies: @@ -3783,6 +3798,17 @@ snapshots: dependencies: eslint: 8.57.0 + eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.2)): + dependencies: + '@typescript-eslint/utils': 7.13.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 + optionalDependencies: + '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + vitest: 1.6.0(@types/node@20.14.2) + transitivePeerDependencies: + - supports-color + - typescript + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 diff --git a/src/async.spec.ts b/src/async.spec.ts index a113469..fe968be 100644 --- a/src/async.spec.ts +++ b/src/async.spec.ts @@ -10,7 +10,7 @@ describe('Async', () => { }); expectTypeOf(matched).toEqualTypeOf(); - expect(matched).toBe(undefined); + expect(matched).toBeUndefined(); }); it('.Ready', () => { @@ -84,6 +84,6 @@ describe('Async', () => { .toNullable(); expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>(); - expect(notAll).toBe(null); + expect(notAll).toBeNull(); }); }); diff --git a/src/maybe.spec.ts b/src/maybe.spec.ts index 9ad937a..d2ee5c7 100644 --- a/src/maybe.spec.ts +++ b/src/maybe.spec.ts @@ -73,7 +73,7 @@ describe('Maybe', () => { const noneValue = Maybe.None.toNullable(); expectTypeOf(noneValue).toEqualTypeOf(); - expect(noneValue).toBe(null); + expect(noneValue).toBeNull(); }); it('#toOptional', () => { @@ -83,7 +83,7 @@ describe('Maybe', () => { const noneValue = Maybe.None.toOptional(); expectTypeOf(noneValue).toEqualTypeOf(); - expect(noneValue).toBe(undefined); + expect(noneValue).toBeUndefined(); }); it('#assertSome', () => { @@ -115,6 +115,6 @@ describe('Maybe', () => { }).toNullable(); expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>(); - expect(notAll).toBe(null); + expect(notAll).toBeNull(); }); }); diff --git a/src/result.spec.ts b/src/result.spec.ts index f4192fe..399bf5d 100644 --- a/src/result.spec.ts +++ b/src/result.spec.ts @@ -164,6 +164,6 @@ describe('Result', () => { .toNullable(); expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>(); - expect(notAll).toBe(null); + expect(notAll).toBeNull(); }); });