Skip to content

Commit

Permalink
Enable Flow lint rule implicit-inexact-object and fix issues
Browse files Browse the repository at this point in the history
Allows dependant code to enable option exact_by_default.
  • Loading branch information
nifgraup committed Dec 11, 2020
1 parent 3670ab8 commit 541fdef
Show file tree
Hide file tree
Showing 39 changed files with 1,010 additions and 545 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PROJECT_ROOT>/node_modules/raf-schd/.*

[lints]
implicit-inexact-object=error
unclear-type=warn
untyped-type-import=error

Expand Down
2 changes: 1 addition & 1 deletion docs/App/GitHubButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';

type Props = { count: number, repo: string };
type Props = { count: number, repo: string, ... };

const StarButton = ({ count, repo }: Props) => (
<div css={{ alignItems: 'center', display: 'inline-flex', minWidth: 128 }}>
Expand Down
4 changes: 2 additions & 2 deletions docs/App/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ const Container = props => (
/>
);

type HeaderProps = RouterProps & { children: Node };
type HeaderState = { contentHeight: 'auto' | number, stars: number };
type HeaderProps = RouterProps & { children: Node, ... };
type HeaderState = { contentHeight: 'auto' | number, stars: number, ... };

const apiUrl = 'https://api.github.com/repos/jedwatson/react-select';

Expand Down
4 changes: 2 additions & 2 deletions docs/App/PageNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const NavSection = () => {
);
};

type NavState = { links: Array<Object>, activeId: string | null };
type NavState = { links: Array<Object>, activeId: string | null, ... };

class PageNav extends Component<RouterProps, NavState> {
scrollSpy: ElementRef<typeof ScrollSpy>;
Expand Down Expand Up @@ -131,7 +131,7 @@ const Nav = (props: any) => (
{...props}
/>
);
type NavItemProps = { level: 2 | 3, selected: boolean };
type NavItemProps = { level: 2 | 3, selected: boolean, ... };

const NavItem = ({ level, selected, ...props }: NavItemProps) => (
<div
Expand Down
2 changes: 2 additions & 0 deletions docs/App/ScrollSpy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import NodeResolver from 'react-node-resolver';
type Props = {
children: ReactElement<*>,
onChange: (Array<any>) => void,
...
};
type State = {
elements: Array<HTMLElement>,
...
};

function getStyle(el, prop, numeric = true) {
Expand Down
2 changes: 2 additions & 0 deletions docs/App/Sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import rafSchedule from 'raf-schd';
type Props = {
children: ReactElement<*>, // Component | Element
preserveHeight: boolean,
...
};
type State = {
height: number | 'auto',
isFixed: boolean,
overScroll: number,
scrollHeight: number | null,
width: number | 'auto',
...
};

export default class Sticky extends Component<Props, State> {
Expand Down
2 changes: 1 addition & 1 deletion docs/App/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const PrimaryNav = (props: any) => (
/>
</div>
);
type PrimaryNavItemProps = ElementConfig<typeof Link> & { selected: boolean };
type PrimaryNavItemProps = ElementConfig<typeof Link> & { selected: boolean, ... };
export const PrimaryNavItem = ({ selected, ...props }: PrimaryNavItemProps) => (
<Link
css={{
Expand Down
2 changes: 1 addition & 1 deletion docs/Svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';

const Svg = ({ size, ...props }: { size: number }) => (
const Svg = ({ size, ...props }: { size: number, ... }) => (
<svg
focusable="false"
height={size}
Expand Down
2 changes: 2 additions & 0 deletions docs/Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as animatedComponents from 'react-select/animated';
type SuiteProps = {
selectComponent: ComponentType<any>,
idSuffix: string,
...
};
type SuiteState = {
isDisabled: boolean,
Expand All @@ -20,6 +21,7 @@ type SuiteState = {
escapeClearsValue: boolean,
blockScroll: boolean,
portalPlacement: MenuPlacement,
...
};

const AnimatedSelect = props => (
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/upgradeGuide/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const getDisplayedStatus = status => {

class PropChanges extends Component<
*,
{ selectedOptions: Array<string>, filterValue: string }
{ selectedOptions: Array<string>, filterValue: string, ... }
> {
state = {
selectedOptions: (allOptions.map(opt => opt.value): Array<string>),
Expand Down
8 changes: 4 additions & 4 deletions docs/styled-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Hr = () => (
/>
);

export const Note = ({ Tag = 'div', ...props }: { Tag?: string }) => (
export const Note = ({ Tag = 'div', ...props }: { Tag?: string, ... }) => (
<Tag
css={{
color: 'hsl(0, 0%, 40%)',
Expand All @@ -49,7 +49,7 @@ export const Note = ({ Tag = 'div', ...props }: { Tag?: string }) => (
export const H1 = (props: any) => <h1 css={{ marginTop: 0 }} {...props} />;
export const H2 = (props: any) => <h2 css={{ marginTop: '2em' }} {...props} />;

export const ColorSample = ({ name, color }: { color: string, name: string }) => (
export const ColorSample = ({ name, color }: { color: string, name: string, ... }) => (
<div
css={{
display: 'inline-flex',
Expand Down Expand Up @@ -77,7 +77,7 @@ export const ColorSample = ({ name, color }: { color: string, name: string }) =>
// Code
// ==============================

export const Code = (props: {}) => (
export const Code = (props: {...}) => (
<code
css={{
backgroundColor: 'rgba(38, 132, 255, 0.08)',
Expand All @@ -90,7 +90,7 @@ export const Code = (props: {}) => (
/>
);

type PreProps = { children: string, language: string };
type PreProps = { children: string, language: string, ... };

export const CodeBlock = ({ children, language, ...props }: PreProps) => {
return (
Expand Down
1 change: 1 addition & 0 deletions docs/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type RouterProps = {
history: RouterHistory,
location: Location,
match: Match,
...
};
Loading

0 comments on commit 541fdef

Please sign in to comment.