Browse Source

use the eslint no-def rule

Gregg Tavares 7 years ago
parent
commit
a5aac4e2e5

+ 4 - 1
build/conf/eslint-examples.json

@@ -10,6 +10,9 @@
     "eslint-plugin-require-trailing-comma"
   ],
   "extends": "eslint:recommended",
+  "globals": {
+        "THREE": true
+  },
   "rules": {
     "no-alert": 2,
     "no-array-constructor": 2,
@@ -73,7 +76,7 @@
     "no-obj-calls": 2,
     "no-redeclare": [0],
     "no-shadow": [0],
-    "no-undef": [0],
+    "no-undef": [2],
     "no-unreachable": 2,
     "one-variable-per-var/one-variable-per-var": [2],
     "quotes": [2, "single"],

+ 1 - 1
build/conf/eslint.json

@@ -72,7 +72,7 @@
     "no-multi-spaces": [0],
     "no-obj-calls": 2,
     "no-shadow": [0],
-    "no-undef": [0],
+    "no-undef": [2],
     "no-unreachable": 2,
     "one-variable-per-var/one-variable-per-var": [2],
     "optional-comma-spacing/optional-comma-spacing": [2, {"after": true}],

+ 3 - 1
threejs/lessons/resources/lesson.js

@@ -1,6 +1,8 @@
-<!-- Licensed under a BSD license. See license.html for license -->
+// Licensed under a BSD license. See license.html for license
 'use strict';
 
+/* global jQuery */
+
 (function($){
 function getQueryParams() {
   const params = {};

+ 2 - 0
threejs/resources/editor.js

@@ -1,6 +1,8 @@
 (function() {
 "use strict";
 
+/* global monaco, require */
+
 const lessonHelperScriptRE = /<script src="[^"]+threejs-lessons-helper\.js"><\/script>/;
 
 function getQuery(s) {

+ 2 - 0
threejs/resources/threejs-lessons-helper.js

@@ -29,6 +29,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* global define */
+
 (function(root, factory) {  // eslint-disable-line
   if (typeof define === 'function' && define.amd) {
     // AMD. Register as an anonymous module.

+ 2 - 0
threejs/threejs-responsive-editor.html

@@ -54,6 +54,8 @@
 <script>
 'use strict';
 
+/* global Split */
+
 // This code is only related to handling the split.
 // Our three.js code has not changed
 Split(['#view', '#controls'], {