Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Commit 9c7f992

Browse files
committed
chore(ESLint): 🚨 Resolve warnings quickly
1 parent 63aaec9 commit 9c7f992

File tree

16 files changed

+89
-77
lines changed

16 files changed

+89
-77
lines changed

‎packages/function/source/schema/schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AsyncFunction, AsyncGeneratorFunction, GeneratorFunction } from "@termi
88
import { isNonPrimitive, validateNonPrimitive } from "@terminal-nerds/snippets-type/non-primitive";
99

1010
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
11-
export type AnyFunction = (...args: any) => any;
11+
export type AnyFunction = (..._args: any) => any;
1212

1313
export function validateFunction(value: unknown): asserts value is AnyFunction {
1414
validateNonPrimitive(value, "function");
@@ -51,7 +51,7 @@ export function isAsyncFunction(_function: AnyFunction): _function is typeof Asy
5151
return IN_BROWSER ? _function instanceof AsyncFunction : nodeIsAsyncFunction(_function);
5252
}
5353

54-
/** @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function any} Async generator function */
54+
/** @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function} Async generator function */
5555
export function isAsyncGeneratorFunction(_function: AnyFunction): _function is typeof AsyncGeneratorFunction {
5656
validateFunction(_function);
5757

@@ -60,7 +60,7 @@ export function isAsyncGeneratorFunction(_function: AnyFunction): _function is t
6060
: isAsyncFunction(_function) && isGeneratorFunction(_function);
6161
}
6262

63-
/** @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function any} Generator function */
63+
/** @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function} Generator function */
6464
export function isGeneratorFunction(_function: AnyFunction): _function is GeneratorFunction {
6565
validateFunction(_function);
6666

‎packages/number/source/random/random.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IN_NODE } from "@terminal-nerds/snippets-runtime/environment";
22

3-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
44
import type { MaxSafeInteger, MinSafeInteger } from "../schema/groups/safe/safe.ts";
55

66
/* prettier-ignore */

‎packages/object/source/keys/keys.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { returns, throws } from "@terminal-nerds/snippets-test/unit";
1+
import { returns } from "@terminal-nerds/snippets-test/unit";
22
import { describe, it } from "vitest";
33

44
import { renameObjectKeys } from "./keys.ts";

‎packages/regexp/source/creator/creator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { z } from "zod";
33

44
export * from "magic-regexp";
55

6+
// TODO: Get rid of this
7+
/* eslint-disable no-unused-vars */
68
export enum REGEXP_FLAGS {
79
/** Case-insensitive search */
810
caseInsensitive = "i",
@@ -19,6 +21,7 @@ export enum REGEXP_FLAGS {
1921
/** Perform a "sticky" search that matches starting at the current position in the target string */
2022
sticky = "y",
2123
}
24+
/* eslint-enable no-unused-vars */
2225

2326
export type RegExpFlagName = keyof typeof REGEXP_FLAGS;
2427

@@ -31,6 +34,7 @@ export function validateRegExpFlag(flag: string): Flag {
3134
export function isValidRegExpFlag(flag: string): flag is Flag {
3235
return REGEXP_FLAG_SCHEMA.safeParse(flag).success;
3336
}
37+
// eslint-disable-next-line no-unused-vars
3438
export type RegExpOptions = Partial<{ [name in RegExpFlagName]: boolean }>;
3539

3640
export function setRegExpFlags(options: RegExpOptions): Array<Flag> {
Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,81 @@
11
/* @vitest-environment edge-runtime */
22

3+
/* eslint-disable jest/no-commented-out-tests */
4+
35
// FIXME: Something is wrong with zod getting instanceof cls.name, when environment is edge-runtime
4-
// import { returns } from "@terminal-nerds/snippets-test/unit";
5-
import { describe, expect, it } from "vitest";
6+
/* import { returns } from "@terminal-nerds/snippets-test/unit"; */
7+
import { describe } from "vitest";
68

7-
// import {
8-
// getRuntimeEnvironmentName,
9-
// IN_BROWSER,
10-
// IN_BUN,
11-
// IN_DENO,
12-
// IN_DOM,
13-
// IN_EDGE,
14-
// IN_HAPPY_DOM,
15-
// IN_JSDOM,
16-
// IN_NODE,
17-
// IN_WEB_WORKER,
18-
// } from "./environment.ts";
9+
/* import { */
10+
/* getRuntimeEnvironmentName, */
11+
/* IN_BROWSER, */
12+
/* IN_BUN, */
13+
/* IN_DENO, */
14+
/* IN_DOM, */
15+
/* IN_EDGE, */
16+
/* IN_HAPPY_DOM, */
17+
/* IN_JSDOM, */
18+
/* IN_NODE, */
19+
/* IN_WEB_WORKER, */
20+
/* } from "./environment.ts"; */
1921

20-
// describe.todo("getRuntimeEnvironmentName() - in Edge Runtime", () => {
21-
// it.fails(returns("edge"), () => {
22-
// expect(getRuntimeEnvironmentName()).toBe("edge");
23-
// });
24-
// });
22+
describe.todo("getRuntimeEnvironmentName() - in Edge Runtime", () => {
23+
/* it.fails(returns("edge"), () => { */
24+
/* expect(getRuntimeEnvironmentName()).toBe("edge"); */
25+
/* }); */
26+
});
2527

2628
describe.todo("IN_BROWSER", () => {
27-
// it.fails(returns(false), () => {
28-
// expect(IN_BROWSER).toBe(false);
29-
// });
29+
/* it.fails(returns(false), () => { */
30+
/* expect(IN_BROWSER).toBe(false); */
31+
/* }); */
3032
});
3133

3234
describe.todo("IN_BUN", () => {
33-
// it.fails(returns(false), () => {
34-
// expect(IN_BUN).toBe(false);
35-
// });
35+
/* it.fails(returns(false), () => { */
36+
/* expect(IN_BUN).toBe(false); */
37+
/* }); */
3638
});
3739

3840
describe.todo("IN_DENO", () => {
39-
// it.fails(returns(false), () => {
40-
// expect(IN_DENO).toBe(false);
41-
// });
41+
/* it.fails(returns(false), () => { */
42+
/* expect(IN_DENO).toBe(false); */
43+
/* }); */
4244
});
4345

4446
describe.todo("IN_DOM", () => {
45-
// it.fails(returns(false), () => {
46-
// expect(IN_DOM).toBe(false);
47-
// });
47+
/* it.fails(returns(false), () => { */
48+
/* expect(IN_DOM).toBe(false); */
49+
/* }); */
4850
});
4951

5052
describe.todo("IN_EDGE_RUNTIME", () => {
51-
// it.fails(returns(true), () => {
52-
// expect(IN_EDGE).toBe(true);
53-
// });
53+
/* it.fails(returns(true), () => { */
54+
/* expect(IN_EDGE).toBe(true); */
55+
/* }); */
5456
});
5557

5658
describe.todo("IN_HAPPY_DOM", () => {
57-
// it.fails(returns(false), () => {
58-
// expect(IN_HAPPY_DOM).toBe(false);
59-
// });
59+
/* it.fails(returns(false), () => { */
60+
/* expect(IN_HAPPY_DOM).toBe(false); */
61+
/* }); */
6062
});
6163

6264
describe.todo("IN_JSDOM", () => {
63-
// it.fails(returns(false), () => {
64-
// expect(IN_JSDOM).toBe(false);
65-
// });
65+
/* it.fails(returns(false), () => { */
66+
/* expect(IN_JSDOM).toBe(false); */
67+
/* }); */
6668
});
6769

6870
describe.todo("IN_NODE", () => {
6971
// NOTE: This test is being run in Node.js.
70-
// it.fails(returns(false), () => {
71-
// expect(IN_NODE).toBe(false);
72-
// });
72+
/* it.fails(returns(false), () => { */
73+
/* expect(IN_NODE).toBe(false); */
74+
/* }); */
7375
});
7476

7577
describe.todo("IN_WEB_WORKER", () => {
76-
// it.fails(returns(false), () => {
77-
// expect(IN_WEB_WORKER).toBe(false);
78-
// });
78+
/* it.fails(returns(false), () => { */
79+
/* expect(IN_WEB_WORKER).toBe(false); */
80+
/* }); */
7981
});

‎packages/runtime/source/variable/variable.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,21 @@ export interface EnvironmentVariableOptions {
4141
strict?: boolean;
4242
}
4343

44-
/** Possible value types of the environment variable */
44+
/** Possible value types of the environment variable. */
4545
export type EnvironmentVariableValue = boolean | number | string;
4646

4747
export function hasEnvironmentVariable(variable: string): boolean {
4848
return toMap(getEnvironmentVariables()).has(variable);
4949
}
5050

51-
/* prettier-ignore */
52-
export function getEnvironmentVariable<ValueType extends EnvironmentVariableValue>(variable: string, options?: { strict?: false }): ValueType | undefined;
53-
/* prettier-ignore */
54-
export function getEnvironmentVariable<ValueType extends EnvironmentVariableValue>(variable: string, options: { strict: true }): ValueType;
51+
export function getEnvironmentVariable<ValueType extends EnvironmentVariableValue>(
52+
_variable: string,
53+
_options?: { strict?: false },
54+
): ValueType | undefined;
55+
export function getEnvironmentVariable<ValueType extends EnvironmentVariableValue>(
56+
_variable: string,
57+
_options: { strict: true },
58+
): ValueType;
5559
export function getEnvironmentVariable<ValueType extends EnvironmentVariableValue>(
5660
variable: string,
5761
options: EnvironmentVariableOptions = {},

‎packages/string/source/case/case.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ export * from "case-anything";
66

77
/** @see {@link https://github.com/mesqueeb/case-anything} */
88
// eslint-disable-next-line import/export
9-
export declare function camelCase<T extends string>(value: T): CamelCase<T>;
9+
export declare function camelCase<T extends string>(_value: T): CamelCase<T>;
1010

1111
/** @see {@link https://github.com/mesqueeb/case-anything} */
1212
// eslint-disable-next-line import/export
13-
export declare function constantCase<T extends string>(value: T): ScreamingSnakeCase<T>;
13+
export declare function constantCase<T extends string>(_value: T): ScreamingSnakeCase<T>;
1414

1515
/** @see {@link https://github.com/mesqueeb/case-anything} */
1616
// eslint-disable-next-line import/export
17-
export declare function kebabCase<T extends string>(value: T): KebabCase<T>;
17+
export declare function kebabCase<T extends string>(_value: T): KebabCase<T>;
1818

1919
/** @see {@link https://github.com/mesqueeb/case-anything} */
2020
// eslint-disable-next-line import/export
21-
export declare function pascalCase<T extends string>(value: T): PascalCase<T>;
21+
export declare function pascalCase<T extends string>(_value: T): PascalCase<T>;
2222

2323
/** @see {@link https://github.com/mesqueeb/case-anything} */
2424
// eslint-disable-next-line import/export
25-
export declare function snakeCase<T extends string>(value: T): SnakeCase<T>;
25+
export declare function snakeCase<T extends string>(_value: T): SnakeCase<T>;

‎packages/string/source/char/char.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const EMPTY_STRINGS = FALSY_STRINGS;
3232
const NON_STRING_VALUES = ALL_SAMPLES.filter((v) => typeof v !== "string");
3333

3434
/* eslint-disable @typescript-eslint/no-explicit-any */
35-
function testInvalidInput(method: (input: any, options?: any) => void, options?: any): void {
35+
function testInvalidInput(method: (_input: any, _options?: any) => void, options?: any): void {
3636
it(throws(ZodError).on(`passed non-string input`), () => {
3737
for (const nonString of NON_STRING_VALUES) {
3838
expect(() => method(nonString, options)).toThrowError(ZodError);
@@ -67,7 +67,7 @@ function testInvalidCharInput(method: Parameters<typeof testInvalidInput>[0]): v
6767
});
6868
}
6969

70-
function testInvalidCharTypeOption(method: (input: string, options: CharOptions<CharType>) => void): void {
70+
function testInvalidCharTypeOption(method: (_input: string, _options: CharOptions<CharType>) => void): void {
7171
const options = { type: "wrong" };
7272

7373
it(throws(ZodError).on(`passed unrecognized char type option`).with(options), () => {

‎packages/string/source/char/char.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function isChar<T extends CharType>(
128128
/* prettier-ignore */
129129
export function hasChars<T extends CharType>(
130130
input: string,
131-
/** @default `{ caseInsensitive: true }` */
131+
/** @defaultValue `{ caseInsensitive: true }` */
132132
options: CharOptions<T>,
133133
): boolean {
134134
const { type, ...regExpOptions } = options;
@@ -151,7 +151,7 @@ export function hasChars<T extends CharType>(
151151
/* prettier-ignore */
152152
export function getChars<T extends CharType>(
153153
input: string,
154-
/** @default `{ caseInsensitive: true, global: true, multiline: true }` */
154+
/** @defaultValue `{ caseInsensitive: true, global: true, multiline: true }` */
155155
options: CharOptions<T>,
156156
): Array<Char<T>> {
157157
const { type, ...regExpOptions } = options;

‎packages/string/source/schema/schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const NON_EMPTY_STRINGS = TRUTHY_STRINGS;
1111
const NON_STRING_VALUES = ALL_SAMPLES.filter((v) => typeof v !== "string");
1212

1313
/* eslint-disable @typescript-eslint/no-explicit-any */
14-
function testInvalidInput(method: (input: any, options?: any) => void, options?: any): void {
14+
function testInvalidInput(method: (_input: any, _options?: any) => void, options?: any): void {
1515
it(throws(ZodError).on(`passed non-string input`), () => {
1616
for (const nonString of NON_STRING_VALUES) {
1717
expect(() => method(nonString, options)).toThrowError(ZodError);

0 commit comments

Comments
 (0)