diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js new file mode 100644 index 0000000000000..c7af41ac969ce --- /dev/null +++ b/src/librustdoc/html/static/.eslintrc.js @@ -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" + ] + } +}; diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 781f99cd6932f..c82d171b69f70 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -10,8 +10,12 @@ * 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) { diff --git a/src/librustdoc/html/static/source-script.js b/src/librustdoc/html/static/source-script.js index 1db8218dae6f2..03b0955a34c31 100644 --- a/src/librustdoc/html/static/source-script.js +++ b/src/librustdoc/html/static/source-script.js @@ -10,6 +10,12 @@ * 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("/"); diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/storage.js index 150001a751445..e8f0c03d91aa6 100644 --- a/src/librustdoc/html/static/storage.js +++ b/src/librustdoc/html/static/storage.js @@ -10,6 +10,9 @@ * except according to those terms. */ +// From rust: +/* global resourcesSuffix */ + var currentTheme = document.getElementById("themeStyle"); var mainTheme = document.getElementById("mainThemeStyle");