Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"],
"EXPERIMENTAL_useProjectService": true,
"projectService": true,
"ecmaFeatures": {
"jsx": false
}
Expand All @@ -28,6 +28,7 @@
}
},
"rules": {
"@typescript-eslint/no-unsafe-function-type": "off",
"import/first": "error",
"import/no-absolute-path": "error",
"import/no-cycle": "error",
Expand Down Expand Up @@ -66,5 +67,13 @@
}
],
"sort-imports": "off"
}
},
"overrides": [
{
"files": "*.test-d.ts",
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"url": "https://github.com/webdeveric/utils/issues"
},
"homepage": "https://github.com/webdeveric/utils/#readme",
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
"packageManager": "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc",
"scripts": {
"clean": "rimraf ./dist/",
"prebuild": "pnpm clean",
Expand All @@ -87,12 +87,12 @@
"devDependencies": {
"@commitlint/config-conventional": "^20.4.1",
"@commitlint/types": "^20.4.0",
"@types/node": "^22.19.8",
"@types/node": "^22.19.11",
"@vitest/coverage-v8": "^3.2.4",
"@webdeveric/eslint-config-ts": "^0.11.0",
"@webdeveric/eslint-config-ts": "^0.12.0",
"@webdeveric/prettier-config": "^0.3.0",
"commitlint": "^20.4.1",
"commitlint-plugin-cspell": "^0.4.0",
"commitlint-plugin-cspell": "^0.5.0",
"conventional-changelog-conventionalcommits": "^9.1.0",
"cspell": "^9.6.4",
"eslint": "^8.57.1",
Expand All @@ -106,7 +106,7 @@
"rimraf": "^6.1.2",
"semantic-release": "^24.2.9",
"typescript": "^5.9.3",
"validate-package-exports": "^0.16.0",
"validate-package-exports": "^0.18.0",
"vitest": "^3.2.4"
},
"pnpm": {
Expand Down
956 changes: 472 additions & 484 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
minimumReleaseAge: 2880 # 2 days
minimumReleaseAgeExclude:
- '@typescript-eslint/*'
- '@webdeveric/eslint-config-ts'
1 change: 0 additions & 1 deletion src/assertion/assertIsFunction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { isFunction } from '../predicate/isFunction.js';

import { getError } from './getError.js';
Expand Down
2 changes: 1 addition & 1 deletion src/describeInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const describeInput = (input: unknown): string => {
const url = new URL(input);

return `${url.protocol.replace(':', '')} URL${url.username || url.password ? ' with credentials' : ''}`;
} catch (error) {
} catch {
return 'Invalid URL';
}
}
Expand Down
1 change: 0 additions & 1 deletion src/predicate/factory/shape.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { hasAdditionalProperties } from '../../hasAdditionalProperties.js';
import { isAnyObject } from '../isAnyObject.js';

Expand Down
1 change: 0 additions & 1 deletion src/predicate/factory/simple.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { InferPredicateReturnType, TypePredicateFn } from '../../types/functions.js';

export type Simple<Type> = Type extends string
Expand Down
1 change: 0 additions & 1 deletion src/predicate/isFunction.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* eslint-disable @typescript-eslint/ban-types */
export const isFunction = (input: unknown): input is Function => typeof input === 'function';
2 changes: 1 addition & 1 deletion src/redactCredentialsInURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const redactCredentialsInURL = (
}

return url.toString();
} catch (error) {
} catch {
return String(input);
}
};
2 changes: 1 addition & 1 deletion src/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-explicit-any */

import type { NotPromise } from './utils.js';

Expand Down
3 changes: 1 addition & 2 deletions src/types/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export type NonNullableProperties<Type> = {
* Return a type containing all method names
*/
export type MethodNames<Type, Key extends keyof Type = keyof Type> = Key extends PropertyKey
? // eslint-disable-next-line @typescript-eslint/ban-types
Type[Key] extends Function
? Type[Key] extends Function
? Key
: never
: never;
Expand Down
1 change: 0 additions & 1 deletion src/types/strings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Digit } from './numbers.js';

// eslint-disable-next-line @typescript-eslint/ban-types
export type AutoCompletableString = string & {};

export type EmptyString = '';
Expand Down
2 changes: 1 addition & 1 deletion src/types/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-explicit-any */

export type IfNever<Type, T, F> = [Type] extends [never] ? T : F;

Expand Down
1 change: 0 additions & 1 deletion test/predicate/factory/assume.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('assume()', () => {
expectTypeOf(assume<undefined>).toEqualTypeOf<TypePredicateFn<undefined>>();
expectTypeOf(assume<null>).toEqualTypeOf<TypePredicateFn<null>>();
expectTypeOf(assume<object>).toEqualTypeOf<TypePredicateFn<object>>();
// eslint-disable-next-line @typescript-eslint/ban-types
expectTypeOf(assume<Function>).toEqualTypeOf<TypePredicateFn<Function>>();
expectTypeOf(assume<unknown>).toEqualTypeOf<TypePredicateFn<unknown>>();
expectTypeOf(assume<string[]>).toEqualTypeOf<TypePredicateFn<string[]>>();
Expand Down
19 changes: 6 additions & 13 deletions test/predicate/factory/fromEnum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('fromEnum()', () => {

describe('enum with number values', () => {
enum Demo {
Demo = 'Demo',
Example = 'Example',
One = 1,
Two = 2,
Expand All @@ -39,18 +38,12 @@ describe('fromEnum()', () => {
expect(fn).toBeInstanceOf(Function);
});

it.each([
Demo.Demo,
Demo.Example,
Demo.One,
Demo.Two,
Demo.Pi,
Demo.NegativeInfinity,
Demo.PositiveInfinity,
Demo.NotANumber,
])('Returns true for valid input: %s', (value) => {
expect(fn(value)).toBeTruthy();
});
it.each([Demo.Example, Demo.One, Demo.Two, Demo.Pi, Demo.NegativeInfinity, Demo.PositiveInfinity, Demo.NotANumber])(
'Returns true for valid input: %s',
(value) => {
expect(fn(value)).toBeTruthy();
},
);

it.each([1, 2, Math.PI, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NaN].map(String))(
'Returns false for invalid input: "%s"',
Expand Down
1 change: 0 additions & 1 deletion test/predicate/factory/simple.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { describe, expectTypeOf, it } from 'vitest';

import { allOf } from '../../../src/predicate/factory/allOf.js';
Expand Down
Loading