]> git.lizzy.rs Git - rust.git/commitdiff
Added a bare-bones eslint config (removing jslint)
authorJohn Heitmann <jheitmann@gmail.com>
Tue, 4 Dec 2018 21:59:27 +0000 (13:59 -0800)
committerJohn Heitmann <jheitmann@gmail.com>
Tue, 4 Dec 2018 23:46:15 +0000 (15:46 -0800)
This change removes the small bit of jslint config, replacing it
with eslint. I've currently configured eslint to mostly only report
the more serious of lints, although there are still some style nits
turned on.

Upcoming changes will start fixing lints.

src/librustdoc/html/static/.eslintrc.js [new file with mode: 0644]
src/librustdoc/html/static/main.js
src/librustdoc/html/static/source-script.js
src/librustdoc/html/static/storage.js

diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js
new file mode 100644 (file)
index 0000000..fbfb0e7
--- /dev/null
@@ -0,0 +1,21 @@
+module.exports = {
+    "env": {
+        "browser": true,
+        "es6": true
+    },
+    "extends": "eslint:recommended",
+    "parserOptions": {
+        "ecmaVersion": 2015,
+        "sourceType": "module"
+    },
+    "rules": {
+        "linebreak-style": [
+            "error",
+            "unix"
+        ],
+        "semi": [
+            "error",
+            "always"
+        ]
+    }
+};
\ No newline at end of file
index 781f99cd6932f6ca4f92cbd964b9c237b161f4a4..c82d171b69f70df7821a2735a4d4228285cb78b2 100644 (file)
  * except according to those terms.
  */
 
-/*jslint browser: true, es5: true */
-/*globals $: true, rootPath: true */
+// From rust:
+/* global ALIASES, currentCrate, rootPath */
+
+// Local js definitions:
+/* global addClass, getCurrentValue, hasClass */
+/* global isHidden onEach, removeClass, updateLocalStorage */
 
 if (!String.prototype.startsWith) {
     String.prototype.startsWith = function(searchString, position) {
index 1db8218dae6f29d044e68fb1d67e0f72da87b895..03b0955a34c310737c754d06c4c159336bbeefe0 100644 (file)
  * except according to those terms.
  */
 
+// From rust:
+/* global sourcesIndex */
+
+// Local js definitions:
+/* global addClass, getCurrentValue, hasClass, removeClass, updateLocalStorage */
+
 function getCurrentFilePath() {
     var parts = window.location.pathname.split("/");
     var rootPathParts = window.rootPath.split("/");
index 150001a7514459e4892c6b5966c892107287215f..e8f0c03d91aa666332503a236f82db9f7cd8b1b2 100644 (file)
@@ -10,6 +10,9 @@
  * except according to those terms.
  */
 
+// From rust:
+/* global resourcesSuffix */
+
 var currentTheme = document.getElementById("themeStyle");
 var mainTheme = document.getElementById("mainThemeStyle");