Skip to content

Commit c4e8b06

Browse files
committed
Removed explicit type declarations
1 parent 95f4969 commit c4e8b06

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

e2e/runJest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function spawnJest(
5959
dir: string,
6060
args: Array<string> = [],
6161
options: RunJestOptions = {},
62-
spawnAsync: boolean = false,
63-
): execa.ExecaSyncReturnValue | execa.ExecaChildProcess {
62+
spawnAsync = false,
63+
): execa.ExecaSyncReturnValue | execa.ExecaChildProcess {
6464
const isRelative = !path.isAbsolute(dir);
6565

6666
if (isRelative) {

packages/expect/src/asymmetricMatchers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Anything extends AsymmetricMatcher<void> {
138138
}
139139

140140
class ArrayContaining extends AsymmetricMatcher<Array<unknown>> {
141-
constructor(sample: Array<unknown>, inverse: boolean = false) {
141+
constructor(sample: Array<unknown>, inverse = false) {
142142
super(sample, inverse);
143143
}
144144

@@ -171,7 +171,7 @@ class ArrayContaining extends AsymmetricMatcher<Array<unknown>> {
171171
}
172172

173173
class ObjectContaining extends AsymmetricMatcher<Record<string, unknown>> {
174-
constructor(sample: Record<string, unknown>, inverse: boolean = false) {
174+
constructor(sample: Record<string, unknown>, inverse = false) {
175175
super(sample, inverse);
176176
}
177177

@@ -209,7 +209,7 @@ class ObjectContaining extends AsymmetricMatcher<Record<string, unknown>> {
209209
}
210210

211211
class StringContaining extends AsymmetricMatcher<string> {
212-
constructor(sample: string, inverse: boolean = false) {
212+
constructor(sample: string, inverse = false) {
213213
if (!isA('String', sample)) {
214214
throw new Error('Expected is not a string');
215215
}
@@ -232,7 +232,7 @@ class StringContaining extends AsymmetricMatcher<string> {
232232
}
233233

234234
class StringMatching extends AsymmetricMatcher<RegExp> {
235-
constructor(sample: string | RegExp, inverse: boolean = false) {
235+
constructor(sample: string | RegExp, inverse = false) {
236236
if (!isA('String', sample) && !isA('RegExp', sample)) {
237237
throw new Error('Expected is not a String or a RegExp');
238238
}

packages/expect/src/jestMatchersObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const setMatchers = <State extends MatcherState = MatcherState>(
6969
State
7070
> {
7171
constructor(
72-
inverse: boolean = false,
72+
inverse = false,
7373
...sample: [unknown, ...Array<unknown>]
7474
) {
7575
super(sample, inverse);

packages/expect/src/matchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const matchers: MatchersObject = {
126126
return {actual: received, expected, message, name: matcherName, pass};
127127
},
128128

129-
toBeCloseTo(received: number, expected: number, precision: number = 2) {
129+
toBeCloseTo(received: number, expected: number, precision = 2) {
130130
const matcherName = 'toBeCloseTo';
131131
const secondArgument = arguments.length === 3 ? 'precision' : undefined;
132132
const isNot = this.isNot;

packages/jest-cli/src/init/generateConfigFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {defaults, descriptions} from 'jest-config';
1111
const stringifyOption = (
1212
option: keyof Config.InitialOptions,
1313
map: Partial<Config.InitialOptions>,
14-
linePrefix: string = '',
15-
): string => {
14+
linePrefix = '',
15+
): string => {
1616
const optionDescription = ` // ${descriptions[option]}`;
1717
const stringifiedObject = `${option}: ${JSON.stringify(
1818
map[option],

packages/jest-cli/src/init/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async (
4848
}
4949

5050
const questions = defaultQuestions.slice(0);
51-
let hasJestProperty: boolean = false;
51+
let hasJestProperty = false;
5252
let projectPackageJson: ProjectPackageJson;
5353

5454
try {
@@ -99,7 +99,7 @@ export default async (
9999
),
100100
);
101101

102-
let promptAborted: boolean = false;
102+
let promptAborted = false;
103103

104104
// @ts-expect-error: Return type cannot be object - faulty typings
105105
const results: PromptsResults = await prompts(questions, {

packages/jest-config/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function readConfig(
4343
// read individual configs for every project.
4444
skipArgvConfigOption?: boolean,
4545
parentConfigDirname?: Config.Path | null,
46-
projectIndex: number = Infinity,
46+
projectIndex = Infinity,
4747
skipMultipleConfigWarning = false,
4848
): Promise<ReadConfig> {
4949
let rawOptions: Config.InitialOptions;

packages/jest-config/src/normalize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ export default async function normalize(
551551
initialOptions: Config.InitialOptions,
552552
argv: Config.Argv,
553553
configPath?: Config.Path | null,
554-
projectIndex: number = Infinity,
555-
): Promise<{
554+
projectIndex = Infinity,
555+
): Promise<{
556556
hasDeprecationWarnings: boolean;
557557
options: AllOptions;
558558
}> {

0 commit comments

Comments
 (0)