Added a bare-bones eslint config (removing jslint)
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.
This commit is contained in:
parent
431e0ab62f
commit
56ace3e870
4 changed files with 36 additions and 2 deletions
21
src/librustdoc/html/static/.eslintrc.js
Normal file
21
src/librustdoc/html/static/.eslintrc.js
Normal file
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
|
@ -10,8 +10,12 @@
|
||||||
* except according to those terms.
|
* except according to those terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*jslint browser: true, es5: true */
|
// From rust:
|
||||||
/*globals $: true, rootPath: true */
|
/* global ALIASES, currentCrate, rootPath */
|
||||||
|
|
||||||
|
// Local js definitions:
|
||||||
|
/* global addClass, getCurrentValue, hasClass */
|
||||||
|
/* global isHidden onEach, removeClass, updateLocalStorage */
|
||||||
|
|
||||||
if (!String.prototype.startsWith) {
|
if (!String.prototype.startsWith) {
|
||||||
String.prototype.startsWith = function(searchString, position) {
|
String.prototype.startsWith = function(searchString, position) {
|
||||||
|
|
|
@ -10,6 +10,12 @@
|
||||||
* except according to those terms.
|
* except according to those terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// From rust:
|
||||||
|
/* global sourcesIndex */
|
||||||
|
|
||||||
|
// Local js definitions:
|
||||||
|
/* global addClass, getCurrentValue, hasClass, removeClass, updateLocalStorage */
|
||||||
|
|
||||||
function getCurrentFilePath() {
|
function getCurrentFilePath() {
|
||||||
var parts = window.location.pathname.split("/");
|
var parts = window.location.pathname.split("/");
|
||||||
var rootPathParts = window.rootPath.split("/");
|
var rootPathParts = window.rootPath.split("/");
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
* except according to those terms.
|
* except according to those terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// From rust:
|
||||||
|
/* global resourcesSuffix */
|
||||||
|
|
||||||
var currentTheme = document.getElementById("themeStyle");
|
var currentTheme = document.getElementById("themeStyle");
|
||||||
var mainTheme = document.getElementById("mainThemeStyle");
|
var mainTheme = document.getElementById("mainThemeStyle");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue