refactor: Be more selective in eslint ignorance (#5955)

Rather than ignoring blockly_uncompressed.js, gulpfile.js and
core/utils/global.js entirely, add suitable eslint-disable directives
to those files so that they lint cleanly (and migrate gulpfile to
use const instead of var).
This commit is contained in:
Christopher Allen
2022-02-23 22:12:15 +00:00
committed by GitHub
parent 5078dcbc6d
commit 00a75ca048
4 changed files with 15 additions and 12 deletions

View File

@@ -1,10 +1,7 @@
*_compressed*.js *_compressed*.js
blockly_uncompressed.js
gulpfile.js
/msg/* /msg/*
/build/* /build/*
/dist/* /dist/*
/core/utils/global.js
/tests/blocks/* /tests/blocks/*
/tests/themes/* /tests/themes/*
/tests/compile/* /tests/compile/*

View File

@@ -10,13 +10,15 @@
'use strict'; 'use strict';
/* eslint-disable no-var */
/** /**
* Blockly uncompiled-mode startup code. If running in a browser * Blockly uncompiled-mode startup code. If running in a browser
* loads closure/goog/base.js and tests/deps.js, then (in any case) * loads closure/goog/base.js and tests/deps.js, then (in any case)
* requires Blockly.requires. * requires Blockly.requires.
*/ */
(function(globalThis) { (function(globalThis) {
/* eslint-disable no-undef */ /* eslint-disable-next-line no-undef */
var IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports); var IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports);
if (IS_NODE_JS) { if (IS_NODE_JS) {
@@ -52,4 +54,5 @@
// Load the rest of Blockly. // Load the rest of Blockly.
document.write('<script>goog.require(\'Blockly\');</script>'); document.write('<script>goog.require(\'Blockly\');</script>');
} }
/* eslint-disable-next-line no-invalid-this */
})(this); })(this);

View File

@@ -16,6 +16,8 @@
goog.module('Blockly.utils.global'); goog.module('Blockly.utils.global');
/* eslint-disable no-undef, no-invalid-this */
/** /**
* Reference to the global object. * Reference to the global object.
* *

View File

@@ -8,16 +8,17 @@
* @fileoverview Gulp script to build Blockly for Node & NPM. * @fileoverview Gulp script to build Blockly for Node & NPM.
* Run this script by calling "npm install" in this directory. * Run this script by calling "npm install" in this directory.
*/ */
/* eslint-env node */
var gulp = require('gulp'); const gulp = require('gulp');
var buildTasks = require('./scripts/gulpfiles/build_tasks'); const buildTasks = require('./scripts/gulpfiles/build_tasks');
var packageTasks = require('./scripts/gulpfiles/package_tasks'); const packageTasks = require('./scripts/gulpfiles/package_tasks');
var gitTasks = require('./scripts/gulpfiles/git_tasks'); const gitTasks = require('./scripts/gulpfiles/git_tasks');
var licenseTasks = require('./scripts/gulpfiles/license_tasks'); const licenseTasks = require('./scripts/gulpfiles/license_tasks');
var appengineTasks = require('./scripts/gulpfiles/appengine_tasks'); const appengineTasks = require('./scripts/gulpfiles/appengine_tasks');
var releaseTasks = require('./scripts/gulpfiles/release_tasks'); const releaseTasks = require('./scripts/gulpfiles/release_tasks');
var cleanupTasks = require('./scripts/gulpfiles/cleanup_tasks'); const cleanupTasks = require('./scripts/gulpfiles/cleanup_tasks');
module.exports = { module.exports = {
deployDemos: appengineTasks.deployDemos, deployDemos: appengineTasks.deployDemos,