Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a bare-bones eslint config (removing jslint) #56523

Merged
merged 2 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/librustdoc/html/static/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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"
]
}
};
8 changes: 6 additions & 2 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions src/librustdoc/html/static/source-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* except according to those terms.
*/

// From rust:
/* global resourcesSuffix */

var currentTheme = document.getElementById("themeStyle");
var mainTheme = document.getElementById("mainThemeStyle");

Expand Down