Skip to content

Commit

Permalink
fix(demo): fix eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Mar 21, 2024
1 parent a72d8ed commit ac9166d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/src/features/customView.workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ registerCustomView({
class CustomEditorPane extends SimpleEditorPane {
static readonly ID = 'workbench.editors.customEditor'

constructor ( ) {
constructor () {
super(CustomEditorPane.ID)
}

Expand Down
2 changes: 2 additions & 0 deletions demo/src/features/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class TerminalBackend extends SimpleTerminalBackend {
override onDidChangeProperty = propertyEmitter.event

override shutdown (immediate: boolean): void {
// eslint-disable-next-line no-console
console.log('shutdown', immediate)
}

Expand All @@ -47,6 +48,7 @@ export class TerminalBackend extends SimpleTerminalBackend {
}

resize (cols: number, rows: number): void {
// eslint-disable-next-line no-console
console.log('resize', cols, rows)
}

Expand Down
10 changes: 5 additions & 5 deletions demo/src/features/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ void getApi().then(async api => {
const lines = text.split('\n')

for (let lineNo = 0; lineNo < lines.length; lineNo++) {
const line = lines[lineNo]
const line = lines[lineNo]!
const test = testRe.exec(line)
if (test != null) {
const [, a, operator, b, expected] = test
const range = new api.Range(new api.Position(lineNo, 0), new api.Position(lineNo, test[0].length))
events.onTest(range, Number(a), operator, Number(b), Number(expected))
events.onTest(range, Number(a), operator!, Number(b), Number(expected))
continue
}

const heading = headingRe.exec(line)
if (heading != null) {
const [, pounds, name] = heading
const range = new api.Range(new api.Position(lineNo, 0), new api.Position(lineNo, line.length))
events.onHeading(range, name, pounds.length)
events.onHeading(range, name!, pounds!.length)
}
}
}
Expand Down Expand Up @@ -91,7 +91,7 @@ void getApi().then(async api => {

parseMarkdown(content, {
onTest: (range, a, operator, b, expected) => {
const parent = ancestors[ancestors.length - 1]
const parent = ancestors[ancestors.length - 1]!
const data = new TestCase(a, operator as Operator, b, expected, thisGeneration)
const id = `${item.uri}/${data.getLabel()}`

Expand All @@ -103,7 +103,7 @@ void getApi().then(async api => {

onHeading: (range, name, depth) => {
ascend(depth)
const parent = ancestors[ancestors.length - 1]
const parent = ancestors[ancestors.length - 1]!
const id = `${item.uri}/${name}`

const thead = controller.createTestItem(id, name, item.uri)
Expand Down
1 change: 1 addition & 0 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"noImplicitReturns": true,
"baseUrl": ".",
"experimentalDecorators": true,
"noUncheckedIndexedAccess": true,
"paths": {
"vscode/vscode/*": ["../dist/main/vscode/src/*"],
"vscode/*": ["../dist/main/*"]
Expand Down

0 comments on commit ac9166d

Please sign in to comment.