diff --git a/fixtures/devtools/regression/shared.js b/fixtures/devtools/regression/shared.js index 920bd9d130d6f..0010fd7ebbb58 100644 --- a/fixtures/devtools/regression/shared.js +++ b/fixtures/devtools/regression/shared.js @@ -1,4 +1,4 @@ -/* eslint-disable react/react-in-jsx-scope, react/jsx-no-undef */ +/* eslint-disable no-fallthrough, react/react-in-jsx-scope, react/jsx-no-undef */ /* global React ReactCache ReactDOM SchedulerTracing ScheduleTracing */ const apps = []; diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js index 4deb8943a196f..20395d09ac090 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js +++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js @@ -350,6 +350,7 @@ function setProp( } } // Fall through to the last case which shouldn't remove empty strings. + // eslint-disable-next-line no-fallthrough case 'formAction': { if ( value == null || @@ -662,7 +663,7 @@ function setProp( if (enableCustomElementPropertySupport) { break; } - // Fall through + // eslint-disable-next-line no-fallthrough default: { if ( key.length > 2 && @@ -760,7 +761,7 @@ function setPropOnCustomElement( if (enableCustomElementPropertySupport) { break; } - // Fall through + // eslint-disable-next-line no-fallthrough default: { if (registrationNameDependencies.hasOwnProperty(key)) { if (__DEV__ && value != null && typeof value !== 'function') { @@ -1009,6 +1010,7 @@ export function setInitialProperties( listenToNonDelegatedEvent('load', domElement); // We fallthrough to the return of the void elements } + // eslint-disable-next-line no-fallthrough case 'area': case 'base': case 'br': @@ -1172,7 +1174,7 @@ export function diffProperties( 'Cannot update the "is" prop after it has been initialized.', ); } - // Fall through + // eslint-disable-next-line no-fallthrough default: { (updatePayload = updatePayload || []).push(propKey, nextProp); } @@ -1788,7 +1790,7 @@ function diffHydratedCustomComponent( } continue; } - // Fall through + // eslint-disable-next-line no-fallthrough case 'className': if (enableCustomElementPropertySupport) { // className is a special cased property on the server to render as an attribute. @@ -1801,7 +1803,7 @@ function diffHydratedCustomComponent( warnForPropDifference('className', serverValue, value); continue; } - // Fall through + // eslint-disable-next-line no-fallthrough default: { let ownNamespaceDev = parentNamespaceDev; if (ownNamespaceDev === HTML_NAMESPACE) { diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js index ab814b1b9053a..6fa9f1deb90c5 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js @@ -319,17 +319,20 @@ export function getEventPriority(domEventName: DOMEventName): EventPriority { case 'touchend': case 'touchstart': case 'volumechange': - // Used by polyfills: (fall through) + // Used by polyfills: + // eslint-disable-next-line no-fallthrough case 'change': case 'selectionchange': case 'textInput': case 'compositionstart': case 'compositionend': case 'compositionupdate': - // Only enableCreateEventHandleAPI: (fall through) + // Only enableCreateEventHandleAPI: + // eslint-disable-next-line no-fallthrough case 'beforeblur': case 'afterblur': - // Not used by React but could be by user code: (fall through) + // Not used by React but could be by user code: + // eslint-disable-next-line no-fallthrough case 'beforeinput': case 'blur': case 'fullscreenchange': @@ -354,7 +357,8 @@ export function getEventPriority(domEventName: DOMEventName): EventPriority { case 'toggle': case 'touchmove': case 'wheel': - // Not used by React but could be by user code: (fall through) + // Not used by React but could be by user code: + // eslint-disable-next-line no-fallthrough case 'mouseenter': case 'mouseleave': case 'pointerenter': diff --git a/packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js b/packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js index 9f1aba93a9a21..2df5fb332fa1d 100644 --- a/packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js +++ b/packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js @@ -693,6 +693,7 @@ function pushAttribute( } } // Fall through to the last case which shouldn't remove empty strings. + // eslint-disable-next-line no-fallthrough case 'formAction': { if ( value == null || @@ -1122,9 +1123,11 @@ function pushStartOption( case 'dangerouslySetInnerHTML': innerHTML = propValue; break; + // eslint-disable-next-line-no-fallthrough case 'value': value = propValue; // We intentionally fallthrough to also set the attribute on the node. + // eslint-disable-next-line-no-fallthrough default: pushAttribute(target, propKey, propValue); break; @@ -1245,6 +1248,7 @@ function pushInput( `${'input'} is a self-closing tag and must neither have \`children\` nor ` + 'use `dangerouslySetInnerHTML`.', ); + // eslint-disable-next-line-no-fallthrough case 'defaultChecked': defaultChecked = propValue; break; @@ -1326,6 +1330,7 @@ function pushStartTextArea( throw new Error( '`dangerouslySetInnerHTML` does not make sense on