Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Audit 2020-03-24 #344

Merged
merged 11 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configs/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'jest/require-to-throw-message': 'off', // Prop type errors
'react/jsx-no-literals': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for tests/stories.

'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},
},
{
Expand Down
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,65 +72,65 @@
"./packages/*"
],
"dependencies": {
"@storybook/addon-a11y": "^5.3.14",
"@storybook/addon-actions": "^5.3.14",
"@storybook/addon-a11y": "^5.3.17",
"@storybook/addon-actions": "^5.3.17",
"@storybook/addon-console": "^1.2.1",
"@storybook/addon-contexts": "^5.3.14",
"@storybook/addon-links": "^5.3.14",
"@storybook/addon-viewport": "^5.3.14",
"@storybook/addons": "^5.3.14",
"@storybook/react": "^5.3.14",
"@storybook/addon-contexts": "^5.3.17",
"@storybook/addon-links": "^5.3.17",
"@storybook/addon-viewport": "^5.3.17",
"@storybook/addons": "^5.3.17",
"@storybook/react": "^5.3.17",
"markdown-to-jsx": "^6.11.0",
"react-element-to-jsx-string": "^14.3.1"
},
"devDependencies": {
"@airbnb/config-babel": "^3.0.0",
"@airbnb/config-eslint": "^3.0.0",
"@airbnb/config-jest": "^3.0.0",
"@airbnb/config-prettier": "^3.0.0",
"@airbnb/config-typescript": "^3.0.0",
"@airbnb/nimbus": "^3.0.0",
"@airbnb/config-babel": "^3.1.0",
"@airbnb/config-eslint": "^3.1.0",
"@airbnb/config-jest": "^3.0.1",
"@airbnb/config-prettier": "^3.1.0",
"@airbnb/config-typescript": "^3.0.1",
"@airbnb/nimbus": "^3.0.1",
"@types/airbnb-prop-types": "^2.13.1",
"@types/enzyme": "^3.10.5",
"@types/filesize": "^5.0.0",
"@types/gh-pages": "^2.0.1",
"@types/google.analytics": "0.0.40",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/jest": "^25.1.3",
"@types/jscodeshift": "^0.6.3",
"@types/jest": "^25.1.4",
"@types/jscodeshift": "^0.7.0",
"@types/lodash": "^4.14.149",
"@types/luxon": "^1.21.0",
"@types/luxon": "^1.22.0",
"@types/node-fetch": "^2.5.5",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9.23",
"@types/react": "^16.9.25",
"@types/react-dom": "^16.9.5",
"@types/react-virtualized": "^9.21.8",
"@types/shallowequal": "^1.1.1",
"@types/svgo": "^1.3.1",
"@types/uuid": "^7.0.0",
"babel-loader": "^8.0.6",
"emojibase-test-utils": "^4.2.1",
"@types/uuid": "^7.0.2",
"babel-loader": "^8.1.0",
"emojibase-test-utils": "^5.0.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.4",
"eslint-plugin-rut": "^1.0.0",
"eslint-plugin-rut": "^1.0.1",
"fast-glob": "^3.1.1",
"filesize": "^6.1.0",
"full-icu": "^1.3.1",
"gh-pages": "^2.2.0",
"happo-plugin-storybook": "^2.5.3",
"happo.io": "^5.1.5",
"jest-rut": "^1.0.0",
"happo.io": "^5.2.0",
"jest-rut": "^1.0.1",
"lerna": "^3.20.2",
"moment": "^2.24.0",
"react": "^16.13.0",
"react-docgen-typescript-loader": "^3.6.0",
"react-dom": "^16.13.0",
"react": "^16.13.1",
"react-docgen-typescript-loader": "^3.7.1",
"react-dom": "^16.13.1",
"rimraf": "^3.0.1",
"rut-dom": "^1.0.0",
"rut-dom": "^1.0.1",
"svgo": "^1.3.2",
"ts-node": "^8.6.2",
"url-loader": "^3.0.0"
"ts-node": "^8.8.1",
"url-loader": "^4.0.0"
},
"resolutions": {
"jsdom": "^15.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"graphql-tag": "^2.10.3",
"react": "^16.13.0",
"react-apollo": "^3.1.3",
"react-test-renderer": "^16.13.0"
"react-test-renderer": "^16.13.1"
},
"dependencies": {
"@types/lodash": "*",
Expand Down
8 changes: 4 additions & 4 deletions packages/apollo/src/components/Mutation/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function executeAGraphQlMutationAndHandleTheResponseWhenReceived() {
return (
<MockedProvider mocks={[mock]} addTypename={false}>
<Mutation mutation={MUTATION} variables={variables}>
{updateUser => <UpdateButton onUpdate={updateUser} />}
{(updateUser) => <UpdateButton onUpdate={updateUser} />}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All parens are prettier changes.

</Mutation>
</MockedProvider>
);
Expand All @@ -96,7 +96,7 @@ export function customLoadingComponent() {
return (
<MockedProvider mocks={[loadingMock]} addTypename={false}>
<Mutation mutation={MUTATION} variables={variables} loading={<Shimmer />}>
{updateUser => <UpdateButton onUpdate={updateUser} />}
{(updateUser) => <UpdateButton onUpdate={updateUser} />}
</Mutation>
</MockedProvider>
);
Expand All @@ -109,8 +109,8 @@ customLoadingComponent.story = {
export function customErrorComponent() {
return (
<MockedProvider mocks={[errorMock]} addTypename={false}>
<Mutation mutation={MUTATION} error={error => <ErrorMessage error={error} />}>
{updateUser => <UpdateButton onUpdate={updateUser} />}
<Mutation mutation={MUTATION} error={(error) => <ErrorMessage error={error} />}>
{(updateUser) => <UpdateButton onUpdate={updateUser} />}
</Mutation>
</MockedProvider>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo/src/components/Query/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function executeAGraphQlQueryAndRenderTheResponseWhenReceived() {
return (
<MockedProvider mocks={[mock]} addTypename={false}>
<Query<{ user: User }> query={QUERY} variables={{ id: 123 }}>
{data => data && <div>Loaded user: {data.user.name}</div>}
{(data) => data && <div>Loaded user: {data.user.name}</div>}
</Query>
</MockedProvider>
);
Expand All @@ -87,7 +87,7 @@ customLoadingComponent.story = {
export function customErrorComponent() {
return (
<MockedProvider mocks={[errorMock]} addTypename={false}>
<Query query={QUERY} error={error => <ErrorMessage error={error} />}>
<Query query={QUERY} error={(error) => <ErrorMessage error={error} />}>
{() => null}
</Query>
</MockedProvider>
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Apollo {
name: Core.settings.name,
resolvers,
typeDefs,
version: pkg.version,
version: (pkg as { version: string }).version,
});

if (__DEV__) {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/src/updaters/removeFromList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function removeFromList<Result, Vars = {}>(
set(
nextResult,
listPath,
list.filter(item => item[idName] !== id),
list.filter((item) => (item as { [key: string]: unknown })[idName] !== id),
);

cache.writeQuery({
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/test/components/Query.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('Query', () => {

mount(
<Query query={QUERY}>
{data => {
{(data) => {
expect(data).toBeNull();

return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/app-shell/src/components/Toasts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Toasts() {

return (
<div className={cx(styles.toasts)}>
{toasts.map(toast => (
{toasts.map((toast) => (
<Toast
{...toast.props}
key={toast.id}
Expand Down
2 changes: 1 addition & 1 deletion packages/app-shell/src/composers/connectToApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function connectToApp(scope: string) /* infer */ {

function ConnectToAppWrapper(props: Props) {
return (
<AppContext.Consumer>{app => <ConnectToApp {...props} app={app} />}</AppContext.Consumer>
<AppContext.Consumer>{(app) => <ConnectToApp {...props} app={app} />}</AppContext.Consumer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions packages/app-shell/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class AppShell extends React.Component<AppShellProps, AppShellState> {
addBreadcrumb = (label: string, props: Breadcrumb['props'] = {}) => {
const id = uuid();

this.setState(prevState => ({
this.setState((prevState) => ({
breadcrumbs: [
...prevState.breadcrumbs,
{
Expand All @@ -60,7 +60,7 @@ export class AppShell extends React.Component<AppShellProps, AppShellState> {
addPageData = (data: object, customID: string = '') => {
const id = customID || uuid();

this.setState(prevState => ({
this.setState((prevState) => ({
data: {
...prevState.data,
[id]: data,
Expand All @@ -73,9 +73,9 @@ export class AppShell extends React.Component<AppShellProps, AppShellState> {
addToast = (message: string | Error, type: ToastType, props: Toast['props'] = {}) => {
const id = props.id || uuid();

this.setState(prevState => ({
this.setState((prevState) => ({
toasts: [
...prevState.toasts.filter(toast => toast.id !== id),
...prevState.toasts.filter((toast) => toast.id !== id),
{
id,
message,
Expand All @@ -101,13 +101,13 @@ export class AppShell extends React.Component<AppShellProps, AppShellState> {
this.addToast(message, 'danger', props);

removeBreadcrumb = (id: string) => {
this.setState(prevState => ({
breadcrumbs: prevState.breadcrumbs.filter(crumb => crumb.id !== id),
this.setState((prevState) => ({
breadcrumbs: prevState.breadcrumbs.filter((crumb) => crumb.id !== id),
}));
};

removePageData = (id: string) => {
this.setState(prevState => {
this.setState((prevState) => {
const data = { ...prevState.data };

delete data[id];
Expand All @@ -117,8 +117,8 @@ export class AppShell extends React.Component<AppShellProps, AppShellState> {
};

removeToast = (id: string) => {
this.setState(prevState => ({
toasts: prevState.toasts.filter(toast => toast.id !== id),
this.setState((prevState) => ({
toasts: prevState.toasts.filter((toast) => toast.id !== id),
}));
};

Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/Composer.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const suggestions: { [phrase: string]: SuggestionConfig[] } = {
};

export function loadSuggestions(phrase: string): Promise<SuggestionConfig[]> {
return new Promise(resolve => {
return new Promise((resolve) => {
setTimeout(
() => {
const key = phrase.toLowerCase();
Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function Actions({ actions, endAlign, noWritingModes }: ActionsPr
</Row>

{acts
.filter(action => (action.condition ? action.condition(context) : true))
.filter((action) => (action.condition ? action.condition(context) : true))
.map((action, i) => {
const Icon = action.icon;
const onClick = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default function Composer({
);

const handleSetMenu = useCallback<Context['setMenu']>(
nextMenu => {
(nextMenu) => {
setMenu(nextMenu);

// Always focus the input when a menu is opened.
Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Emojis/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Emojis({ internal = false, startAlign = false }: EmojisP
const handleSelect = useCallback(
(emoji: CanonicalEmoji) => {
// istanbul ignore next
setData('value', value => `${value} ${emoji.unicode}`);
setData('value', (value) => `${value} ${emoji.unicode}`);
},
[setData],
);
Expand Down
4 changes: 2 additions & 2 deletions packages/composer/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Footer() {
const [styles, cx] = useStyles(footerStyleSheet);

// Select active hotkeys for the current view
const tips = Array.from(hotkeys.values()).filter(hotkey => hotkey.condition(context));
const tips = Array.from(hotkeys.values()).filter((hotkey) => hotkey.condition(context));

// Sort hotkeys by order
tips.sort((a, b) => a.order! - b.order!);
Expand All @@ -25,7 +25,7 @@ export default function Footer() {

return (
<footer className={cx(styles.footer)}>
{tips.map(tip => (
{tips.map((tip) => (
<Tip key={tip.name || tip.combo}>
<Mark>
{tip.combo.split('+').map((symbol, i) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Input/InlineInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function InlineInput({ label, name, value }: InlineInputProps) {
prefix={<Prefix small>{textLabel}</Prefix>}
suffix={<Suffix small>{editButton}</Suffix>}
value={value}
onChange={nextValue => {
onChange={(nextValue) => {
context.setData(name, nextValue);
}}
/>
Expand Down
10 changes: 7 additions & 3 deletions packages/composer/src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export default function Input({
context,
);
} catch (error) {
context.setError(error.message);
if (error instanceof Error) {
context.setError(error.message);
}
}
},
[onChange, context],
Expand Down Expand Up @@ -119,7 +121,9 @@ export default function Input({
);
}
} catch (error) {
context.setError(error.message);
if (error instanceof Error) {
context.setError(error.message);
}
}
}, [blocked, onSubmit, context]);

Expand Down Expand Up @@ -162,7 +166,7 @@ export default function Input({
</section>

<textarea
ref={element => {
ref={(element) => {
passThroughRef(ref, element);
passThroughRef(propagateRef, element);
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Menu/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ToggleButtonProps = {
export default function ToggleButton({ accessibilityLabel, icon, menu }: ToggleButtonProps) {
const { setMenu } = useContext(ComposerContext);
const handleToggle = useCallback(() => {
setMenu(activeMenu => (activeMenu === menu ? '' : menu));
setMenu((activeMenu) => (activeMenu === menu ? '' : menu));
}, [setMenu, menu]);

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/composer/src/components/Preview/Proofreader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function Proofreader({
locale: selectedLocale,
text: value,
})
.then(proofreadErrors => {
.then((proofreadErrors) => {
if (mounted) {
setErrors([...customErrors, ...proofreadErrors]);
setLoading(false);
Expand Down Expand Up @@ -116,7 +116,7 @@ export default function Proofreader({
nextValue += value.slice(offset + error.length!);

handleUnselectError();
setErrors(errors.filter(e => e !== error));
setErrors(errors.filter((e) => e !== error));
context.setData('value', nextValue);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/composer/src/components/Preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function Preview({
name="showPreview"
label={T.phrase('lunar.composer.hotkey.returnToPreview', 'to preview')}
order={100}
onRun={ctx => onSubmitShowPreview(ctx.data, ctx)}
onRun={(ctx) => onSubmitShowPreview(ctx.data, ctx)}
/>

<Menu
Expand Down
Loading