mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
refactor: fix a lot of errors in type-aware linting (#7477)
This commit is contained in:
parent
222bf3c091
commit
bf1513a3e3
120 changed files with 407 additions and 364 deletions
|
@ -171,7 +171,7 @@ export function parseLines(
|
|||
const metastringRangeClassName = magicComments[0]!.className;
|
||||
const lines = rangeParser(linesRange)
|
||||
.filter((n) => n > 0)
|
||||
.map((n) => [n - 1, [metastringRangeClassName]]);
|
||||
.map((n) => [n - 1, [metastringRangeClassName]] as [number, string[]]);
|
||||
return {lineClassNames: Object.fromEntries(lines), code};
|
||||
}
|
||||
if (language === undefined) {
|
||||
|
@ -189,7 +189,7 @@ export function parseLines(
|
|||
const lineToClassName: {[comment: string]: string} = Object.fromEntries(
|
||||
magicComments
|
||||
.filter((d) => d.line)
|
||||
.map(({className, line}) => [line, className]),
|
||||
.map(({className, line}) => [line!, className] as [string, string]),
|
||||
);
|
||||
const blockStartToClassName: {[comment: string]: string} = Object.fromEntries(
|
||||
magicComments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue