Merge pull request #15752 from Snuffleupagus/no-typeof-undefined
Enable the `no-typeof-undefined` ESLint plugin rule
This commit is contained in:
commit
99cfef882f
@ -61,6 +61,7 @@
|
|||||||
"unicorn/prefer-modern-dom-apis": "error",
|
"unicorn/prefer-modern-dom-apis": "error",
|
||||||
"unicorn/prefer-regexp-test": "error",
|
"unicorn/prefer-regexp-test": "error",
|
||||||
"unicorn/prefer-string-starts-ends-with": "error",
|
"unicorn/prefer-string-starts-ends-with": "error",
|
||||||
|
"unicorn/no-typeof-undefined": ["error", { "checkGlobalVariables": false, }],
|
||||||
|
|
||||||
// Possible errors
|
// Possible errors
|
||||||
"for-direction": "error",
|
"for-direction": "error",
|
||||||
|
@ -1870,8 +1870,7 @@ class CanvasGraphics {
|
|||||||
this.ctx.closePath();
|
this.ctx.closePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
stroke(consumePath) {
|
stroke(consumePath = true) {
|
||||||
consumePath = typeof consumePath !== "undefined" ? consumePath : true;
|
|
||||||
const ctx = this.ctx;
|
const ctx = this.ctx;
|
||||||
const strokeColor = this.current.strokeColor;
|
const strokeColor = this.current.strokeColor;
|
||||||
// For stroke we want to temporarily change the global alpha to the
|
// For stroke we want to temporarily change the global alpha to the
|
||||||
@ -1904,8 +1903,7 @@ class CanvasGraphics {
|
|||||||
this.stroke();
|
this.stroke();
|
||||||
}
|
}
|
||||||
|
|
||||||
fill(consumePath) {
|
fill(consumePath = true) {
|
||||||
consumePath = typeof consumePath !== "undefined" ? consumePath : true;
|
|
||||||
const ctx = this.ctx;
|
const ctx = this.ctx;
|
||||||
const fillColor = this.current.fillColor;
|
const fillColor = this.current.fillColor;
|
||||||
const isPatternFill = this.current.patternFill;
|
const isPatternFill = this.current.patternFill;
|
||||||
|
@ -46,7 +46,7 @@ function createHeaders(httpHeaders) {
|
|||||||
const headers = new Headers();
|
const headers = new Headers();
|
||||||
for (const property in httpHeaders) {
|
for (const property in httpHeaders) {
|
||||||
const value = httpHeaders[property];
|
const value = httpHeaders[property];
|
||||||
if (typeof value === "undefined") {
|
if (value === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
headers.append(property, value);
|
headers.append(property, value);
|
||||||
|
@ -82,7 +82,7 @@ class NetworkManager {
|
|||||||
xhr.withCredentials = this.withCredentials;
|
xhr.withCredentials = this.withCredentials;
|
||||||
for (const property in this.httpHeaders) {
|
for (const property in this.httpHeaders) {
|
||||||
const value = this.httpHeaders[property];
|
const value = this.httpHeaders[property];
|
||||||
if (typeof value === "undefined") {
|
if (value === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
xhr.setRequestHeader(property, value);
|
xhr.setRequestHeader(property, value);
|
||||||
|
@ -373,7 +373,7 @@ class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|||||||
this._httpHeaders = {};
|
this._httpHeaders = {};
|
||||||
for (const property in stream.httpHeaders) {
|
for (const property in stream.httpHeaders) {
|
||||||
const value = stream.httpHeaders[property];
|
const value = stream.httpHeaders[property];
|
||||||
if (typeof value === "undefined") {
|
if (value === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this._httpHeaders[property] = value;
|
this._httpHeaders[property] = value;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* eslint-disable no-var */
|
/* eslint-disable no-var, unicorn/no-typeof-undefined */
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const TestReporter = function (browser) {
|
|||||||
status,
|
status,
|
||||||
description,
|
description,
|
||||||
};
|
};
|
||||||
if (typeof error !== "undefined") {
|
if (error !== undefined) {
|
||||||
message.error = error;
|
message.error = error;
|
||||||
}
|
}
|
||||||
send("/submit_task_results", message);
|
send("/submit_task_results", message);
|
||||||
|
Loading…
Reference in New Issue
Block a user