Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stricter tsconfig settings #50

Merged
merged 3 commits into from
Oct 28, 2019
Merged

Stricter tsconfig settings #50

merged 3 commits into from
Oct 28, 2019

Conversation

roblourens
Copy link
Member

#36

Adds a couple tsconfig rules. Some 'any' casts where the intent is not clear, some actual type fixes.

@@ -398,7 +398,7 @@ export class Thread implements VariableStoreDelegate {
}

this._pausedDetails = this._createPausedDetails(event);
this._pausedDetails[kPausedEventSymbol] = event;
Copy link
Member

@connor4312 connor4312 Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much refactoring you wanna do here, but this is a good use case for a WeakMap (and actually most WeakMap polyfills work almost the same way as the code does here--defining a non-enumerable symbol on the key objects 😛 )

@@ -35,7 +35,7 @@ export function caseInsensitiveMerge<V>(
return {};
}

const out = {};
const out: any = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const out: any = {};
const out: { [key: string]: V } = {};

should work

@@ -57,7 +57,7 @@ function formLaunchArgs(

const argsWithDefaults = { ...chromeLaunchConfigDefaults, ...launchArgs };
for (let k in argsWithDefaults) {
launchArgs[k] = argsWithDefaults[k];
launchArgs[k] = (argsWithDefaults as any)[k]; // TODO@rob
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL multiline suggestions aren't a thing, somehow, but

Object.assign(launchArgs, argsWithDefaults)

should do the trick without casts

@@ -228,7 +228,7 @@ function createLaunchConfigFromContext(
dir += '/';
}
}
config['preLaunchTask'] = 'tsc: build - tsconfig.json';
(config as any)['preLaunchTask'] = 'tsc: build - tsconfig.json';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably add this as preLaunchTask?: string; in IMandatedConfiguration

@@ -323,7 +323,7 @@ function readEnvFile(file: string): { [key: string]: string } {
}

const buffer = stripBOM(fs.readFileSync(file, 'utf8'));
const env = {};
const env: any = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const env: any = {};
const env: { [key: string]: string } = {};

Copy link
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some suggestions

@roblourens roblourens merged commit 72532a1 into master Oct 28, 2019
@roblourens roblourens deleted the roblou/tsconfig2 branch October 28, 2019 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants