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

Build: Update dependencies #81

Merged
merged 4 commits into from
May 21, 2021
Merged

Build: Update dependencies #81

merged 4 commits into from
May 21, 2021

Conversation

mgol
Copy link
Member

@mgol mgol commented May 20, 2021

This makes all dependencies up to date and switches the project from JSHint to ESLint. That resolves most reported security issues.

A significant number of changes had to be made to jquery-wp-content to make it compatible with the new highlight.js; that PR needs to land first.

Ref jquery/jquery-wp-content#430

Copy link
Member

@fnagel fnagel left a comment

Choose a reason for hiding this comment

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

+1 by reading


exports.syntaxHighlight = syntaxHighlight;

exports.postPreprocessors = {
_default: function( post, fileName, callback ) {
_default( post, _fileName, callback ) {
Copy link
Member

Choose a reason for hiding this comment

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

Did you add this underscore on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, our ESLint config requires all variables & function parameters to be used inside of the function body. For parameters it's not possible in 100% of cases and then prefixing with an underscore is an opt-out.

Copy link
Member

Choose a reason for hiding this comment

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

We should probably use after-used

Copy link
Member Author

@mgol mgol May 20, 2021

Choose a reason for hiding this comment

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

We had a discussion about that some time ago and we decided to use all as there are more cases where we'd leave internal unused parameters than in APIs where they have to be there. This applies especially to AMD module definitions where we've been constantly missing unused dependencies.

We had to prefix some parameters with _ in Core because of this rule but there weren't too many of them.

@mgol
Copy link
Member Author

mgol commented May 20, 2021

jQuery .css() docs:

Before:
Screen Shot 2021-05-20 at 17 30 55

After:
Screen Shot 2021-05-20 at 18 02 52

jQuery UI Datepicker docs:

Before:
Screen Shot 2021-05-20 at 17 31 17

After:
Screen Shot 2021-05-20 at 18 04 03

.eslintignore Outdated
@@ -0,0 +1 @@
node_modules/**
Copy link
Member

Choose a reason for hiding this comment

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

This should be redundant afaik.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I guess I can remove the whole file then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@timmywil timmywil left a comment

Choose a reason for hiding this comment

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

LGTM

@Krinkle Krinkle merged commit 27a54fb into jquery:main May 21, 2021
@mgol mgol deleted the updates branch May 22, 2021 01:12
@mgol
Copy link
Member Author

mgol commented May 22, 2021

@Krinkle the convention for the Closes line is:

Closes gh-81

not:

Closes https://github.com/jquery/grunt-jquery-content/pull/81.

See https://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants