Skip to content

Commit

Permalink
rm some ts ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 11, 2019
1 parent 7129ef9 commit 5d17268
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lighthouse-core/computed/bundle-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ function computeGeneratedFileSizes(map, content) {
// @ts-ignore: This function is added in SDK.js
map.computeLastGeneratedColumns();

// @ts-ignore
for (const mapping of map.mappings()) {
const source = mapping.sourceURL;
const lineNum = mapping.lineNumber;
const colNum = mapping.columnNumber;
// @ts-ignore
const lastColNum = mapping.lastColumnNumber;
// @ts-ignore: `lastColumnNumber` is not on types yet.
const lastColNum = /** @type {number=} */ (mapping.lastColumnNumber);

// Webpack sometimes emits null mappings.
// https://github.com/mozilla/source-map/pull/303
Expand All @@ -65,22 +64,19 @@ function computeGeneratedFileSizes(map, content) {
// Lines are 1-based
const line = lines[lineNum];
if (line === null) {
// @ts-ignore
log.error(`${map.compiledURL} mapping for line out of bounds: ${lineNum + 1}`);
return failureResult;
}

// Columns are 0-based
if (colNum >= line.length) {
// @ts-ignore
log.error(`${map.compiledURL} mapping for column out of bounds: ${lineNum + 1}:${colNum}`);
return failureResult;
}

let mappingLength = 0;
if (lastColNum !== undefined) {
if (lastColNum >= line.length) {
// @ts-ignore
// eslint-disable-next-line max-len
log.error(`${map.compiledURL} mapping for last column out of bounds: ${lineNum + 1}:${lastColNum}`);
return failureResult;
Expand Down

0 comments on commit 5d17268

Please sign in to comment.