Skip to content

Commit 0086bf2

Browse files
committed
lint: enable reportUnusedDisableDirectives and remove unused suppressions
This enables linting against unused suppressions and removes the ones that were unused.
1 parent 8cb6a1c commit 0086bf2

File tree

56 files changed

+44
-125
lines changed

Some content is hidden

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

56 files changed

+44
-125
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ module.exports = {
1717
// Stop ESLint from looking for a configuration file in parent folders
1818
root: true,
1919

20+
reportUnusedDisableDirectives: true,
21+
2022
plugins: [
2123
'babel',
2224
'ft-flow',

packages/react-client/src/ReactFlightReplyClient.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ export function processReply(
243243
const partJSON = JSON.stringify(resolvedModel, resolveToJSON);
244244
// $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
245245
const data: FormData = formData;
246-
// eslint-disable-next-line react-internal/safe-string-coercion
247246
data.append(formFieldPrefix + lazyId, partJSON);
248247
return serializeByValueID(lazyId);
249248
} catch (x) {
@@ -263,7 +262,6 @@ export function processReply(
263262
const partJSON = JSON.stringify(value, resolveToJSON);
264263
// $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
265264
const data: FormData = formData;
266-
// eslint-disable-next-line react-internal/safe-string-coercion
267265
data.append(formFieldPrefix + lazyId, partJSON);
268266
pendingParts--;
269267
if (pendingParts === 0) {
@@ -304,7 +302,6 @@ export function processReply(
304302
const partJSON = JSON.stringify(partValue, resolveToJSON);
305303
// $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
306304
const data: FormData = formData;
307-
// eslint-disable-next-line react-internal/safe-string-coercion
308305
data.append(formFieldPrefix + promiseId, partJSON);
309306
pendingParts--;
310307
if (pendingParts === 0) {
@@ -459,7 +456,6 @@ export function processReply(
459456
}
460457
// The reference to this function came from the same client so we can pass it back.
461458
const refId = nextPartId++;
462-
// eslint-disable-next-line react-internal/safe-string-coercion
463459
formData.set(formFieldPrefix + refId, metaDataJSON);
464460
return serializeServerReferenceID(refId);
465461
}

packages/react-client/src/forks/ReactFlightClientConfig.custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const usedWithSSR = true;
4242

4343
export opaque type Source = mixed;
4444

45-
export opaque type StringDecoder = mixed; // eslint-disable-line no-undef
45+
export opaque type StringDecoder = mixed;
4646

4747
export const createStringDecoder = $$$config.createStringDecoder;
4848
export const readPartialStringChunk = $$$config.readPartialStringChunk;

packages/react-devtools-extensions/flow-typed/jest.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,11 @@ type JestPromiseType = {
146146
* Use rejects to unwrap the reason of a rejected promise so any other
147147
* matcher can be chained. If the promise is fulfilled the assertion fails.
148148
*/
149-
// eslint-disable-next-line no-use-before-define
150149
rejects: JestExpectType,
151150
/**
152151
* Use resolves to unwrap the value of a fulfilled promise so any other
153152
* matcher can be chained. If the promise is rejected the assertion fails.
154153
*/
155-
// eslint-disable-next-line no-use-before-define
156154
resolves: JestExpectType,
157155
};
158156

@@ -1098,10 +1096,8 @@ type JestPrettyFormatColors = {
10981096
};
10991097

11001098
type JestPrettyFormatIndent = string => string;
1101-
// eslint-disable-next-line no-unused-vars
11021099
type JestPrettyFormatRefs = Array<any>;
11031100
type JestPrettyFormatPrint = any => string;
1104-
// eslint-disable-next-line no-unused-vars
11051101
type JestPrettyFormatStringOrNull = string | null;
11061102

11071103
type JestPrettyFormatOptions = {
@@ -1112,7 +1108,6 @@ type JestPrettyFormatOptions = {
11121108
indent: number,
11131109
maxDepth: number,
11141110
min: boolean,
1115-
// eslint-disable-next-line no-use-before-define
11161111
plugins: JestPrettyFormatPlugins,
11171112
printFunctionName: boolean,
11181113
spacing: string,

packages/react-devtools-extensions/flow-typed/npm/react-test-renderer_v16.x.x.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ type TestRendererOptions = {
5252
};
5353

5454
declare module 'react-test-renderer' {
55-
// eslint-disable-next-line no-inner-declarations
5655
declare export type ReactTestRenderer = {
5756
toJSON(): null | ReactTestRendererJSON,
5857
toTree(): null | ReactTestRendererTree,

packages/react-devtools-shared/src/__tests__/inspectedElement-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ describe('InspectedElement', () => {
664664
anonymous_fn={instance.anonymousFunction}
665665
array_buffer={arrayBuffer}
666666
array_of_arrays={arrayOfArrays}
667-
// eslint-disable-next-line no-undef
668667
big_int={BigInt(123)}
669668
bound_fn={exampleFunction.bind(this)}
670669
data_view={dataView}
@@ -1874,7 +1873,7 @@ describe('InspectedElement', () => {
18741873
xyz: 1,
18751874
},
18761875
});
1877-
const bigInt = BigInt(123); // eslint-disable-line no-undef
1876+
const bigInt = BigInt(123);
18781877

18791878
await utils.actAsync(() =>
18801879
render(

packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ describe('InspectedElementContext', () => {
182182
anonymous_fn={instance.anonymousFunction}
183183
array_buffer={arrayBuffer}
184184
array_of_arrays={arrayOfArrays}
185-
// eslint-disable-next-line no-undef
186185
big_int={BigInt(123)}
187186
bound_fn={exampleFunction.bind(this)}
188187
data_view={dataView}
@@ -868,7 +867,7 @@ describe('InspectedElementContext', () => {
868867
xyz: 1,
869868
},
870869
});
871-
const bigInt = BigInt(123); // eslint-disable-line no-undef
870+
const bigInt = BigInt(123);
872871

873872
act(() =>
874873
ReactDOM.render(

packages/react-devtools-shared/src/backend/DevToolsConsolePatching.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ disabledLog.__reactDisabledLog = true;
3030

3131
export function disableLogs(): void {
3232
if (disabledDepth === 0) {
33-
/* eslint-disable react-internal/no-production-logging */
3433
prevLog = console.log;
3534
prevInfo = console.info;
3635
prevWarn = console.warn;
@@ -63,7 +62,6 @@ export function disableLogs(): void {
6362
export function reenableLogs(): void {
6463
disabledDepth--;
6564
if (disabledDepth === 0) {
66-
/* eslint-disable react-internal/no-production-logging */
6765
const props = {
6866
configurable: true,
6967
enumerable: true,

packages/react-devtools-shared/src/backend/renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,6 @@ export function attach(
15451545
return changedKeys;
15461546
}
15471547

1548-
// eslint-disable-next-line no-unused-vars
15491548
function didFiberRender(prevFiber: Fiber, nextFiber: Fiber): boolean {
15501549
switch (nextFiber.tag) {
15511550
case ClassComponent:

packages/react-devtools-shell/src/app/InspectableElements/UnserializableProps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const immutable = Immutable.fromJS({
3131
xyz: 1,
3232
},
3333
});
34-
const bigInt = BigInt(123); // eslint-disable-line no-undef
34+
const bigInt = BigInt(123);
3535

3636
class Foo {
3737
flag = false;

0 commit comments

Comments
 (0)