mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 09:23:05 +00:00
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
@ -41,4 +41,4 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
|
||||
/scripts/validate-error-codes.sh && \
|
||||
# Runs checks to ensure that there are no ES5 issues in our JS code.
|
||||
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": [
|
||||
"error",
|
||||
"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
|
||||
// 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.
|
||||
/* eslint-env es6 */
|
||||
/* eslint no-var: "error" */
|
||||
/* eslint prefer-const: "error" */
|
||||
|
||||
/* eslint-disable */
|
||||
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:
|
||||
/* global addClass, getSettingValue, hasClass, searchState */
|
||||
/* 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 */
|
||||
|
||||
"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 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:
|
||||
/* global getSettingValue, getVirtualKey, updateLocalStorage, updateSystemTheme */
|
||||
/* 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:
|
||||
/* 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";
|
||||
|
||||
const darkThemes = ["dark", "ayu"];
|
||||
|
Loading…
Reference in New Issue
Block a user