Skip to content

Commit 3be8bb2

Browse files
aduthswissspidymanzoorwanijk
authored
Testing: Enable no-unused-disable ESLint Comments plugin rule (#72940)
* Testing: Enable no-unused-disable ESLint Comments plugin rule * Fix existing issues with no-unused-disable * Remove "disable reason" comments that don't refer to anything * Fix more formatting irregularities * Ignore generated icon files for ESLint These files are auto-generated, and expected to have some formatting issues. However, blanket disabling Prettier is incompatible with no-unused-disable because some of the files are fine as-is. A better long-term solution would be to apply Prettier to the generated output, similar to what's done in `packages/theme` for Theme artifacts. * Resolve issues after changing ESLint resolver Co-authored-by: aduth <aduth@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
1 parent bf390b4 commit 3be8bb2

File tree

82 files changed

+25
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+25
-188
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build-types
55
build-wp
66
node_modules
77
packages/block-serialization-spec-parser/parser.js
8+
packages/icons/src/library/*.tsx
89
packages/react-native-editor/bundle
910
vendor
1011
!.*.js

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ module.exports = {
168168
],
169169
'@wordpress/no-unsafe-wp-apis': 'off',
170170
'@wordpress/data-no-store-string-literals': 'error',
171+
'eslint-comments/no-unused-disable': 'error',
171172
'import/default': 'error',
172173
'import/named': 'error',
173174
'no-restricted-imports': [

bin/generate-php-sync-issue.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ async function fetchCommit( sha ) {
430430
} );
431431
}
432432

433-
// eslint-disable-next-line no-unused-vars
434433
async function getPullRequestDataForCommit( commitSha ) {
435434
const pullRequests = await octokitRequest(
436435
'GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls',

packages/autop/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* The regular expression for an HTML element.
33
*/
44
const htmlSplitRegex: RegExp = ( () => {
5-
/* eslint-disable no-multi-spaces */
65
const comments =
76
'!' + // Start of comment, after the <.
87
'(?:' + // Unroll the loop: Consume everything until --> is found.
@@ -43,7 +42,6 @@ const htmlSplitRegex: RegExp = ( () => {
4342
')';
4443

4544
return new RegExp( regex );
46-
/* eslint-enable no-multi-spaces */
4745
} )();
4846

4947
/**

packages/block-directory/src/plugins/get-install-missing/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import { store as blockDirectoryStore } from '../../store';
2121

2222
const getInstallMissing = ( OriginalComponent ) => ( props ) => {
2323
const { originalName } = props.attributes;
24-
// Disable reason: This is a valid component, but it's mistaken for a callback.
25-
// eslint-disable-next-line react-hooks/rules-of-hooks
2624
const { block, hasPermission } = useSelect(
2725
( select ) => {
2826
const { getDownloadableBlocks } = select( blockDirectoryStore );

packages/block-editor/src/components/block-popover/inbetween.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ function BlockPopoverInbetween( {
217217
return null;
218218
}
219219

220-
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
221220
// While ideally it would be enough to capture the
222221
// bubbling focus event from the Inserter, due to the
223222
// characteristics of click focusing of `button`s in
@@ -253,7 +252,6 @@ function BlockPopoverInbetween( {
253252
</div>
254253
</Popover>
255254
);
256-
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
257255
}
258256

259257
export default BlockPopoverInbetween;

packages/block-editor/src/components/iframe/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@ function Iframe( {
342342
>
343343
{ iframeDocument &&
344344
createPortal(
345-
// We want to prevent React events from bubbling through the iframe
346-
// we bubble these manually.
347-
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
348345
<body
349346
ref={ bodyRef }
350347
className={ clsx(

packages/block-editor/src/components/link-control/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ import deprecated from '@wordpress/deprecated';
4949
* providing a custom `settings` prop.
5050
*/
5151

52-
/* eslint-disable jsdoc/valid-types */
5352
/**
5453
* Custom settings values associated with a link.
5554
*
5655
* @typedef {{[setting:string]:any}} WPLinkControlSettingsValue
5756
*/
58-
/* eslint-enable */
5957

6058
/**
6159
* Custom settings values associated with a link.

packages/block-editor/src/components/list-view/expander.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export default function ListViewExpander( { onClick } ) {
1313
//
1414
// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.
1515
// For the current tree grid implementation, please do not try to make this a button.
16-
//
17-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1816
<span
1917
className="block-editor-list-view__expander"
2018
onClick={ ( event ) => onClick( event, { forceToggle: true } ) }

packages/block-editor/src/components/media-replace-flow/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ const MediaReplaceFlow = ( {
257257
: children }
258258
</NavigableMenu>
259259
{ onSelectURL && (
260-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
261260
<form className="block-editor-media-flow__url-input">
262261
<span className="block-editor-media-replace-flow__image-url-label">
263262
{ __( 'Current media URL:' ) }

0 commit comments

Comments
 (0)