Skip to content

Commit

Permalink
eslint: For no-empty, set allowEmptyCatch false (#38486)
Browse files Browse the repository at this point in the history
The "no-empty" can be satisfied with anything, even a comment saying why
we're ignoring the exception. Since that's probably a useful comment to
have, let's do that.

For a few files, do something different:
* `projects/plugins/jetpack/extensions/shared/block-editor-asset-loader.js`
  can return directly from the `catch`, the following check would only
  fail if the catch caught.
* `projects/plugins/jetpack/modules/shortcodes/js/jmpress.js` is a
  copy-pasted external library. We should `.eslintignore` it as well as
  two others in that directory.
* `projects/plugins/jetpack/tools/webpack.config.extensions.js` would
  error on the next line after the catch anyway, so skip catching at
  all.

This brings us more in line with the ruleset imported from
`@wordpress/eslint-plugin`.

Also, have tools/cleanup-excludelists.sh clean up ignored files. The
"File ignored because of a matching ignore pattern" warning shouldn't
keep files in the list.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10162158508

Upstream-Ref: Automattic/jetpack@d1c2b52
  • Loading branch information
arcangelini authored and matticbot committed Jul 30, 2024
1 parent ab045e7 commit 786dfb0
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 786dfb0

Please sign in to comment.