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

@@ -217,7 +217,7 @@ function wrapScore(
lineLengths[lineLengths.length - 1]++;
}
}
const maxLength = Math.max.apply(Math, lineLengths);
const maxLength = Math.max(...lineLengths);
let score = 0;
for (let i = 0; i < lineLengths.length; i++) {

View File

@@ -303,4 +303,4 @@ export function getContainerOffsetToScrollInto(
export const TEST_ONLY = {
getSizeInternal,
}
};

View File

@@ -22,7 +22,7 @@ goog.declareModuleId('Blockly.utils.Svg');
* A name with the type of the SVG element stored in the generic.
* @alias Blockly.utils.Svg
*/
export class Svg<T> {
export class Svg<_T> {
/** @internal */
static ANIMATE = new Svg<SVGAnimateElement>('animate');
/** @internal */

View File

@@ -430,4 +430,4 @@ export function parseToolboxTree(toolboxDef: Element|null|string): Element|
export const TEST_ONLY = {
hasCategoriesInternal,
}
};