-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix good lints given by eslint-plugin-unicorn #55517
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
Changes from 7 commits
ea72ed8
e72cade
c9ed25d
4089625
85b689b
57b777e
a65798d
61f5fb1
62206d9
d575268
a6a82bf
c8263be
db0344e
a834ea6
8f707b5
18f411d
2145843
fef5532
b1d2b24
1764b8e
695ed0f
74b6550
4681bc0
7771ddf
844233b
33366b2
200ee8b
3da23d0
eb7ba9f
c251a2b
12ad192
ee0f535
a079fd6
5fae6cc
5ac2b65
10fafc0
ce92c95
2a4ac4e
e0ae3ff
f2853a1
c1814d3
e0e8eaa
571bd74
5998579
e35981f
37c2dca
10fc6fa
ceb0ebb
9bcfd34
507fffc
da0907f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2481,7 +2481,7 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi | |
| version: undefined, | ||
| }, | ||
| watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), | ||
| references: map(configParseResult.projectReferences, r => ({ ...r, path: r.originalPath ? r.originalPath : "", originalPath: undefined })), | ||
| references: map(configParseResult.projectReferences, r => ({ ...r, path: r.originalPath || "", originalPath: undefined })), | ||
| files: length(files) ? files : undefined, | ||
| ...(configParseResult.options.configFile?.configFileSpecs ? { | ||
| include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs), | ||
|
|
@@ -2493,10 +2493,8 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi | |
| } | ||
|
|
||
| /** @internal */ | ||
| export function optionMapToObject(optionMap: Map<string, CompilerOptionsValue>): object { | ||
| return { | ||
| ...arrayFrom(optionMap.entries()).reduce((prev, cur) => ({ ...prev, [cur[0]]: cur[1] }), {}), | ||
| }; | ||
| export function optionMapToObject(optionMap: Map<string, CompilerOptionsValue>) { | ||
| return Object.fromEntries(optionMap.entries()); | ||
| } | ||
|
|
||
| function filterSameAsDefaultInclude(specs: readonly string[] | undefined) { | ||
|
|
@@ -2615,7 +2613,7 @@ export function getCompilerOptionsDiffValue(options: CompilerOptions, newLine: s | |
| return getOverwrittenDefaultOptions(); | ||
|
|
||
| function makePadding(paddingLength: number): string { | ||
| return Array(paddingLength + 1).join(" "); | ||
| return new Array(paddingLength + 1).join(" "); | ||
This comment was marked as resolved.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah: #55515 (comment)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though really I don't know why this isn't just |
||
| } | ||
|
|
||
| function getOverwrittenDefaultOptions() { | ||
|
|
@@ -2659,7 +2657,7 @@ export function generateTSConfig(options: CompilerOptions, fileNames: readonly s | |
| return writeConfigurations(); | ||
|
|
||
| function makePadding(paddingLength: number): string { | ||
| return Array(paddingLength + 1).join(" "); | ||
| return new Array(paddingLength + 1).join(" "); | ||
| } | ||
|
|
||
| function isAllowedOptionForOutput({ category, name, isCommandLineOnly }: CommandLineOption): boolean { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just seems like a weird pattern in general. Particularly since
filterdoesn't short-circuit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't disagree, I didn't write it, but I am fixing it 😅