Skip to content

Commit

Permalink
[ESLint] enable unicorn/prefer-array-flat-map rule (#3044)
Browse files Browse the repository at this point in the history
* enable `unicorn/prefer-array-flat-map` rule

* format
  • Loading branch information
dimaMachina authored Mar 4, 2023
1 parent 16f4951 commit deeb467
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ module.exports = {
'no-lonely-if': 'error',
'unicorn/no-lonely-if': 'error',
'unicorn/prefer-optional-catch-binding': 'error',
'unicorn/prefer-array-flat-map': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'sonarjs/no-small-switch': 'error',
Expand Down
5 changes: 1 addition & 4 deletions packages/graphiql-react/src/execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ export function ExecutionContextProvider(props: ExecutionContextProviderProps) {
};
const maybeErrors = [
...(fullResponse?.errors || []),
...maybeMultipart
.map(i => i.errors)
.flat()
.filter(Boolean),
...maybeMultipart.flatMap(i => i.errors).filter(Boolean),
];

if (maybeErrors.length) {
Expand Down

0 comments on commit deeb467

Please sign in to comment.