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

Change eslint rules from configuration comments to configuration file #96805

Merged
merged 1 commit into from
May 7, 2022
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
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I no sure the change of this line is necessary, however, to make it explicit, I prefer to keep this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prefer to keep this change.

5 changes: 4 additions & 1 deletion src/librustdoc/html/static/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = {
"semi": [
"error",
"always"
]
],
"no-var": ["error"],
"prefer-const": ["error"],
"prefer-arrow-callback": ["error"],
}
};
3 changes: 0 additions & 3 deletions src/librustdoc/html/static/js/externs.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/js/scrape-examples.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
@@ -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 */

Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/js/settings.js
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
5 changes: 0 additions & 5 deletions src/librustdoc/html/static/js/source-script.js
Original file line number Diff line number Diff line change
@@ -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 */

Expand Down
5 changes: 0 additions & 5 deletions src/librustdoc/html/static/js/storage.js
Original file line number Diff line number Diff line change
@@ -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"];
Expand Down