chore: enable linting ts files (#6351)

* chore: initial setup for linting ts

* chore: Temporarily disable most of the rules causing problems

* chore: fix autofixable problems.

* chore: ignore the last few files and rules

* chore: fix remaining lint errors

* chore: fix more small lint

* chore: run original rules on js files, new ts rules on ts files

* chore: use jsdoc style return in js files

* chore: add lint fix script

* chore: fix prefer-spread lint

* chore: fix no-invalid-this rule

* chore: fix no-unused-vars

* chore: fix trashcan lint
This commit is contained in:
Maribeth Bottorff
2022-08-16 13:59:15 -07:00
committed by GitHub
parent 9830641cb7
commit 49f87fba79
48 changed files with 560 additions and 79 deletions

View File

@@ -353,13 +353,13 @@ export class Workspace implements IASTNodeLocation {
const topBlocks = this.getTopBlocks(true);
blocks = [];
for (let i = 0; i < topBlocks.length; i++) {
blocks.push.apply(blocks, topBlocks[i].getDescendants(true));
blocks.push(...topBlocks[i].getDescendants(true));
}
} else {
// Fast, but in no particular order.
blocks = this.getTopBlocks(false);
for (let i = 0; i < blocks.length; i++) {
blocks.push.apply(blocks, blocks[i].getChildren(false));
blocks.push(...blocks[i].getChildren(false));
}
}
@@ -518,6 +518,7 @@ export class Workspace implements IASTNodeLocation {
* ID.
* @return The created block.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
newBlock(prototypeName: string, opt_id?: string): Block {
throw new Error(
'The implementation of newBlock should be ' +