Skip to content

Commit

Permalink
chore(deps-dev): bump prettier from 3.0.3 to 3.1.0 (#4587)
Browse files Browse the repository at this point in the history
Closes #4573
  • Loading branch information
char0n authored Nov 16, 2023
1 parent 6b1982d commit 64ebb1f
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 80 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"newlines-between": "always"
}],
"no-nested-ternary": "off",
"prettier/prettier": "error",
"react/react-in-jsx-scope": 0,
"react/function-component-definition": [1, {
Expand Down
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"jest-canvas-mock": "^2.5.2",
"jest-watch-typeahead": "^2.2.2",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"react-scripts": "file:./create-react-app/packages/react-scripts",
"rimraf": "^5.0.5",
"sass": "^1.69.5",
Expand Down
14 changes: 6 additions & 8 deletions src/plugins/editor-content-type/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,15 @@ export const selectInferFileNameFromContent = createSelector(
selectIsContentTypeOpenAPI31x,
selectIsContentTypeAsyncAPI2,
(isOpenAPI20, isOpenAPI30x, isOpenAPI31x, isAsyncAPI2) => {
/* eslint-disable no-nested-ternary */
return isOpenAPI20
? 'openapi2'
: isOpenAPI30x
? 'openapi3_0'
: isOpenAPI31x
? 'openapi3_1'
: isAsyncAPI2
? 'asyncapi2'
: 'definition';
/* eslint-enable */
? 'openapi3_0'
: isOpenAPI31x
? 'openapi3_1'
: isAsyncAPI2
? 'asyncapi2'
: 'definition';
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const createDereferenceActionDescriptor = ({ getSystem }) => ({
const worker = await getWorker()(model.uri);
const dereferenced = await worker.doDeref(model.uri.toString(), {
baseURI: globalThis.document.baseURI || globalThis.location.href,
format: isContentJSON ? 0 : isContentYAML ? 1 : 'unknown', // eslint-disable-line no-nested-ternary
format: isContentJSON ? 0 : isContentYAML ? 1 : 'unknown',
});

if (isContentYAML) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Suspense, useEffect } from 'react';
import PropTypes from 'prop-types';

const AsyncApiReactComponent = React.lazy(() =>
import('@asyncapi/react-component/lib/esm/without-parser.js')
const AsyncApiReactComponent = React.lazy(
() => import('@asyncapi/react-component/lib/esm/without-parser.js')
);

const Loading = () => <div>Loading...</div>;
Expand Down
10 changes: 4 additions & 6 deletions src/plugins/top-bar/actions/convert-openapi-20-to-openapi-30x.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ export const convertOpenAPI20ToOpenAPI30xSuccess = ({
});

export const convertOpenAPI20ToOpenAPI30xFailure = ({ error, openAPI2Content, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_CONVERT_OPENAPI_2_TO_OPENAPI_30X_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export const fetchOpenAPI2GeneratorClientListSuccess = ({ clientList, url, reque
});

export const fetchOpenAPI2GeneratorClientListFailure = ({ error, url, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_FETCH_OPENAPI2_GENERATOR_CLIENT_LIST_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export const fetchOpenAPI2GeneratorServerListSuccess = ({ serverList, url, reque
});

export const fetchOpenAPI2GeneratorServerListFailure = ({ error, url, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_FETCH_OPENAPI2_GENERATOR_SERVER_LIST_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export const fetchOpenAPI3GeneratorClientListSuccess = ({ clientList, url, reque
});

export const fetchOpenAPI3GeneratorClientListFailure = ({ error, url, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_FETCH_OPENAPI3_GENERATOR_CLIENT_LIST_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export const fetchOpenAPI3GeneratorServerListSuccess = ({ serverList, url, reque
});

export const fetchOpenAPI3GeneratorServerListFailure = ({ error, url, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_FETCH_OPENAPI3_GENERATOR_SERVER_LIST_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ export const generateClientCodeFromOpenAPI20Success = ({
});

export const generateClientCodeFromOpenAPI20Failure = ({ error, content, language, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_GENERATE_CLIENT_CODE_FROM_OPENAPI20_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ export const generateClientCodeFromOpenAPI3Success = ({
});

export const generateClientCodeFromOpenAPI3Failure = ({ error, content, language, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_GENERATE_CLIENT_CODE_FROM_OPENAPI3_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ export const generateServerCodeFromOpenAPI20Failure = ({
framework,
requestId,
}) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_GENERATE_SERVER_CODE_FROM_OPENAPI20_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ export const generateServerCodeFromOpenAPI3Success = ({
});

export const generateServerCodeFromOpenAPI3Failure = ({ error, content, framework, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_TOP_BAR_GENERATE_SERVER_CODE_FROM_OPENAPI3_FAILURE,
Expand Down
10 changes: 4 additions & 6 deletions src/plugins/top-bar/actions/import-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ export const importUrlSuccess = ({ definition, requestId }) => ({
});

export const importUrlFailure = ({ error, url, requestId }) => {
/* eslint-disable no-nested-ternary */
const errorMessage = error.response
? 'The request was made and the server responded with a status code that falls out of the range of 2xx'
: error.request
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';
/* eslint-enable */
? 'The request was made but no response was received'
: error.message
? error.message
: 'Unknown error occurred';

return {
type: EDITOR_IMPORT_URL_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import PropTypes from 'prop-types';

const SaveAsMenuItem = ({ getComponent, editorSelectors, onClick, children }) => {
const DropdownMenuItem = getComponent('DropdownMenuItem');
// eslint-disable-next-line no-nested-ternary
const itemName = editorSelectors.selectIsContentFormatJSON()
? 'Save (as JSON)'
: editorSelectors.selectIsContentFormatYAML()
? 'Save (as YAML)'
: 'Save';
? 'Save (as YAML)'
: 'Save';

return <DropdownMenuItem onClick={onClick}>{children || itemName}</DropdownMenuItem>;
};
Expand Down

0 comments on commit 64ebb1f

Please sign in to comment.