-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix eslint warnings and add eslint check in CI #2554
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
Conversation
a87b0c6
to
7f4f189
Compare
Rebased and fixed merge conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add documentation to https://github.com/rust-lang/mdBook/blob/master/CONTRIBUTING.md with links to what this is, how to install it, and some information on how to run and use it?
@@ -64,7 +64,6 @@ pub fn create_files( | |||
} | |||
|
|||
if search_config.copy_js { | |||
static_files.add_builtin("searchindex.json", index.as_bytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this line changing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see it's from another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! From #2552 to be more exact.
.eslintrc.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you say how all the rules for this were created? Why are the styles different from the defaults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the rules we use in rustdoc. "defaults" change from time to time, so with this set of rule, at least it's fixed.
tests/gui/runner.rs
Outdated
if let Some(version) = line.strip_prefix("BROWSER_UI_TEST_VERSION:") { | ||
return version.trim().replace('\'', ""); | ||
let content = read_to_string("package.json").expect("failed to read `package.json`"); | ||
let json = json::parse(&content).expect("invalid JSON"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this use serde_json since it is already in the dependency tree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
Sure! |
Applied suggestions. |
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
First commit comes from #2552.
This PR fixed all eslint warnings and added it as a check in the CI. That is a first step in improving the JS quality.
cc @notriddle