Rollup merge of #96805 - Folyd:eslint, r=GuillaumeGomez
Change eslint rules from configuration comments to configuration file Repeatedly declaring eslint rules in source files is an annoying thing, we should move those rules into the eslint configuration file. r? ``@GuillaumeGomez``
This commit is contained in:
commit
f98f92fdaf
9 changed files with 5 additions and 31 deletions
|
@ -41,4 +41,4 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
|
||||||
/scripts/validate-error-codes.sh && \
|
/scripts/validate-error-codes.sh && \
|
||||||
# Runs checks to ensure that there are no ES5 issues in our JS code.
|
# Runs checks to ensure that there are no ES5 issues in our JS code.
|
||||||
es-check es6 ../src/librustdoc/html/static/js/*.js && \
|
es-check es6 ../src/librustdoc/html/static/js/*.js && \
|
||||||
eslint ../src/librustdoc/html/static/js/*.js
|
eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js
|
||||||
|
|
|
@ -16,6 +16,9 @@ module.exports = {
|
||||||
"semi": [
|
"semi": [
|
||||||
"error",
|
"error",
|
||||||
"always"
|
"always"
|
||||||
]
|
],
|
||||||
|
"no-var": ["error"],
|
||||||
|
"prefer-const": ["error"],
|
||||||
|
"prefer-arrow-callback": ["error"],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// This file contains type definitions that are processed by the Closure Compiler but are
|
// This file contains type definitions that are processed by the Closure Compiler but are
|
||||||
// not put into the JavaScript we include as part of the documentation. It is used for
|
// not put into the JavaScript we include as part of the documentation. It is used for
|
||||||
// type checking. See README.md in this directory for more info.
|
// type checking. See README.md in this directory for more info.
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
let searchState;
|
let searchState;
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
// Local js definitions:
|
// Local js definitions:
|
||||||
/* global addClass, getSettingValue, hasClass, searchState */
|
/* global addClass, getSettingValue, hasClass, searchState */
|
||||||
/* global onEach, onEachLazy, removeClass */
|
/* global onEach, onEachLazy, removeClass */
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
/* global addClass, hasClass, removeClass, onEachLazy */
|
/* global addClass, hasClass, removeClass, onEachLazy */
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
/* global addClass, getNakedUrl, getSettingValue, hasOwnPropertyRustdoc, initSearch, onEach */
|
/* global addClass, getNakedUrl, getSettingValue, hasOwnPropertyRustdoc, initSearch, onEach */
|
||||||
/* global onEachLazy, removeClass, searchState, browserSupportsHistoryApi */
|
/* global onEachLazy, removeClass, searchState, browserSupportsHistoryApi */
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
// Local js definitions:
|
// Local js definitions:
|
||||||
/* global getSettingValue, getVirtualKey, updateLocalStorage, updateSystemTheme */
|
/* global getSettingValue, getVirtualKey, updateLocalStorage, updateSystemTheme */
|
||||||
/* global addClass, removeClass, onEach, onEachLazy, NOT_DISPLAYED_ID */
|
/* global addClass, removeClass, onEach, onEachLazy, NOT_DISPLAYED_ID */
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
|
|
||||||
// From rust:
|
// From rust:
|
||||||
/* global search, sourcesIndex */
|
/* global search, sourcesIndex */
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
/* eslint no-var: "error" */
|
|
||||||
/* eslint prefer-const: "error" */
|
|
||||||
/* eslint prefer-arrow-callback: "error" */
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const darkThemes = ["dark", "ayu"];
|
const darkThemes = ["dark", "ayu"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue