Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani committed Jan 19, 2024
1 parent d2965c4 commit ceab07f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/configurator/knobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export const knobs = [
}),
] as const;

export type Knob = typeof knobs[number];
export type Knob = (typeof knobs)[number];
export type KnobId = Knob['id'];

type KnobsById = {[K in Knob as K['id']]: K};
Expand All @@ -253,7 +253,7 @@ export const knobsBySection = {} as {[section: string]: Knob[]};
for (const knob of knobs) {
// Cast to an arbitrary specific Knob type here because TypeScript isn't quite
// clever enough to know that the id will match the type.
knobsById[(knob as typeof knobs[0]).id] = knob as typeof knobs[0];
knobsById[(knob as (typeof knobs)[0]).id] = knob as (typeof knobs)[0];
let catArr = knobsBySection[knob.section];
if (catArr === undefined) {
catArr = knobsBySection[knob.section] = [];
Expand Down
9 changes: 5 additions & 4 deletions src/typescript-worker/diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ export function makeLspDiagnostic(tsDiagnostic: ts.Diagnostic): lsp.Diagnostic {
* we got them right with a type constraint.
*/
const diagnosticCategoryMapping: {
[ts.DiagnosticCategory.Error]: typeof lsp.DiagnosticSeverity['Error'];
[ts.DiagnosticCategory.Warning]: typeof lsp.DiagnosticSeverity['Warning'];
[ts.DiagnosticCategory.Message]: typeof lsp.DiagnosticSeverity['Information'];
[ts.DiagnosticCategory.Suggestion]: typeof lsp.DiagnosticSeverity['Hint'];
[ts.DiagnosticCategory.Error]: (typeof lsp.DiagnosticSeverity)['Error'];
[ts.DiagnosticCategory.Warning]: (typeof lsp.DiagnosticSeverity)['Warning'];
[ts.DiagnosticCategory
.Message]: (typeof lsp.DiagnosticSeverity)['Information'];
[ts.DiagnosticCategory.Suggestion]: (typeof lsp.DiagnosticSeverity)['Hint'];
} = {
[ts.DiagnosticCategory.Error]: 1,
[ts.DiagnosticCategory.Warning]: 2,
Expand Down

0 comments on commit ceab07f

Please sign in to comment.