Skip to content

Commit 0c4a409

Browse files
committed
bump flow so there are no errors
1 parent 5e1ead0 commit 0c4a409

13 files changed

+23
-20
lines changed

__mocks__/genInteractives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function genInteractiveElements(): Array<JSXElementMockType> {
170170
if (bracketIndex > -1) {
171171
name = elementSymbol.slice(0, bracketIndex);
172172
}
173-
const attributes = interactiveElementsMap[elementSymbol].map(({ prop, value }) => JSXAttributeMock(prop, value));
173+
const attributes = interactiveElementsMap[elementSymbol as any].map(({ prop, value }) => JSXAttributeMock(prop, value));
174174
return JSXElementMock(name, attributes);
175175
});
176176
}

__tests__/__util__/ruleOptionsMapperFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function ruleOptionsMapperFactory(ruleOptions: Array<mixed> = [])
2323
code,
2424
errors,
2525
// Flatten the array of objects in an array of one object.
26-
options: [fromEntries((options || []).concat(ruleOptions).flatMap((item) => entries(item)))],
26+
options: [fromEntries((options || []).concat(ruleOptions).flatMap((item) => entries(item as any)))],
2727
parserOptions,
2828
settings,
2929
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"eslint-plugin-flowtype": "^5.8.0 || ^8.0.3",
5757
"eslint-plugin-import": "^2.31.0",
5858
"estraverse": "^5.3.0",
59-
"flow-bin": "^0.147.0",
59+
"flow-bin": "^0.250.0",
6060
"in-publish": "^2.0.1",
6161
"jackspeak": "=2.1.1",
6262
"jscodeshift": "^17.0.0",

src/rules/anchor-ambiguous-text.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// ----------------------------------------------------------------------------
88
// Rule Definition
99
// ----------------------------------------------------------------------------
10-
11-
import type { ESLintConfig, ESLintContext } from '../../flow/eslint';
10+
import type { ESLintConfig, ESLintContext } from "../../flow/eslint";
1211
import { arraySchema, generateObjSchema } from '../util/schemas';
1312
import getAccessibleChildText from '../util/getAccessibleChildText';
1413
import getElementType from '../util/getElementType';
@@ -44,7 +43,7 @@ export default ({
4443
const ambiguousWords = new Set(words);
4544

4645
return {
47-
JSXOpeningElement: (node) => {
46+
JSXOpeningElement: (node: any) => {
4847
const nodeType = elementType(node);
4948

5049
// Only check anchor elements and custom types.
@@ -64,7 +63,7 @@ export default ({
6463
data: {
6564
wordsList: words.join('", "'),
6665
},
67-
});
66+
} as any);
6867
},
6968
};
7069
},

src/rules/anchor-is-valid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default ({
6060

6161
// Create active aspect flag object. Failing checks will only report
6262
// if the related flag is set to true.
63-
const activeAspects = {};
63+
const activeAspects: Object = {};
6464
allAspects.forEach((aspect) => {
6565
activeAspects[aspect] = aspects.indexOf(aspect) !== -1;
6666
});

src/rules/control-has-associated-label.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import { getProp, getLiteralPropValue } from 'jsx-ast-utils';
1313
import type { JSXElement } from 'ast-types-flow';
1414
import { generateObjSchema, arraySchema } from '../util/schemas';
15-
import type { ESLintConfig, ESLintContext, ESLintVisitorSelectorConfig } from '../../flow/eslint';
15+
import type {
16+
ESLintConfig,
17+
ESLintContext,
18+
ESLintVisitorSelectorConfig,
19+
} from "../../flow/eslint";
1620
import getElementType from '../util/getElementType';
1721
import isDOMElement from '../util/isDOMElement';
1822
import isHiddenFromScreenReader from '../util/isHiddenFromScreenReader';

src/rules/label-has-associated-control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const schema = generateObjSchema({
3636
},
3737
});
3838

39-
function validateID(node, context) {
39+
function validateID(node: Object, context: Object) {
4040
const { settings } = context;
4141
const htmlForAttributes = settings['jsx-a11y']?.attributes?.for ?? ['htmlFor'];
4242

src/rules/media-has-caption.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ const schema = generateObjSchema({
2525
track: arraySchema,
2626
});
2727

28-
const isMediaType = (context, type) => {
28+
const isMediaType = (context: Object, type: string) => {
2929
const options = context.options[0] || {};
3030
return MEDIA_TYPES
3131
.concat(MEDIA_TYPES.flatMap((mediaType) => options[mediaType]))
3232
.some((typeToCheck) => typeToCheck === type);
3333
};
3434

35-
const isTrackType = (context, type) => {
35+
const isTrackType = (context: Object, type: string) => {
3636
const options = context.options[0] || {};
3737
return ['track'].concat(options.track || []).some((typeToCheck) => typeToCheck === type);
3838
};

src/rules/mouse-events-have-key-events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default ({
4040
},
4141

4242
create: (context: ESLintContext) => ({
43-
JSXOpeningElement: (node) => {
43+
JSXOpeningElement: (node: Object) => {
4444
const { name } = node.name;
4545

4646
if (!dom.get(name)) {

src/rules/no-redundant-roles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import getImplicitRole from '../util/getImplicitRole';
1717

1818
const { hasOwn } = Object;
1919

20-
const errorMessage = (element, implicitRole) => (
20+
const errorMessage = (element: string, implicitRole: string) => (
2121
`The element ${element} has an implicit role of ${implicitRole}. Defining this explicitly is redundant and should be avoided.`
2222
);
2323

@@ -46,7 +46,7 @@ export default ({
4646
const elementType = getElementType(context);
4747
return {
4848
JSXOpeningElement: (node: JSXOpeningElement) => {
49-
const type = elementType(node);
49+
const type: any = elementType(node);
5050
const implicitRole = getImplicitRole(type, node.attributes);
5151
const explicitRole = getExplicitRole(type, node.attributes);
5252

0 commit comments

Comments
 (0)