chore(deps): update dependency prettier to v1.19.1 (#2893)

* chore(deps): update dependency prettier to v1.19.1

* style: format files after prettier upgrade
This commit is contained in:
Erez Rokah
2019-11-18 17:51:51 +02:00
committed by GitHub
parent e00aab2a8b
commit ead46af194
17 changed files with 80 additions and 81 deletions

View File

@ -119,7 +119,7 @@
"nock": "^11.0.0", "nock": "^11.0.0",
"node-fetch": "^2.3.0", "node-fetch": "^2.3.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "1.18.2", "prettier": "^1.19.1",
"react-test-renderer": "^16.8.4", "react-test-renderer": "^16.8.4",
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"simple-git": "^1.124.0", "simple-git": "^1.124.0",

View File

@ -627,9 +627,11 @@ export default class API {
const metadata = await this.retrieveMetadata(contentKey); const metadata = await this.retrieveMetadata(contentKey);
// mark media files to remove // mark media files to remove
const metadataMediaFiles = get(metadata, 'objects.files', []); const metadataMediaFiles = get(metadata, 'objects.files', []);
const mediaFilesToRemove = differenceBy(metadataMediaFiles, mediaFilesList, 'path').map( const mediaFilesToRemove = differenceBy(
file => ({ ...file, remove: true }), metadataMediaFiles,
); mediaFilesList,
'path',
).map(file => ({ ...file, remove: true }));
const branchData = await this.getBranch(branchName); const branchData = await this.getBranch(branchName);
const changeTree = await this.updateTree( const changeTree = await this.updateTree(
branchData.commit.sha, branchData.commit.sha,

View File

@ -57,7 +57,10 @@ describe('entries', () => {
{ {
name: 'images', name: 'images',
widget: 'list', widget: 'list',
fields: [{ name: 'title', widget: 'text' }, { name: 'url', widget: 'text' }], fields: [
{ name: 'title', widget: 'text' },
{ name: 'url', widget: 'text' },
],
}, },
]); ]);
expect(createEmptyDraftData(fields)).toEqual({}); expect(createEmptyDraftData(fields)).toEqual({});
@ -95,7 +98,10 @@ describe('entries', () => {
{ {
name: 'post', name: 'post',
widget: 'object', widget: 'object',
fields: [{ name: 'title', widget: 'text' }, { name: 'url', widget: 'text' }], fields: [
{ name: 'title', widget: 'text' },
{ name: 'url', widget: 'text' },
],
}, },
]); ]);
expect(createEmptyDraftData(fields)).toEqual({}); expect(createEmptyDraftData(fields)).toEqual({});

View File

@ -407,9 +407,10 @@ export class Backend {
const { raw, path, mediaFiles = [], assets = [] } = backup; const { raw, path, mediaFiles = [], assets = [] } = backup;
const label = selectFileEntryLabel(collection, slug); const label = selectFileEntryLabel(collection, slug);
const entry = this.entryWithFormat(collection, slug)( const entry = this.entryWithFormat(
createEntry(collection.get('name'), slug, path, { raw, label }), collection,
); slug,
)(createEntry(collection.get('name'), slug, path, { raw, label }));
return { entry, mediaFiles, assets }; return { entry, mediaFiles, assets };
} }
@ -446,7 +447,10 @@ export class Backend {
const path = selectEntryPath(collection, slug); const path = selectEntryPath(collection, slug);
const label = selectFileEntryLabel(collection, slug); const label = selectFileEntryLabel(collection, slug);
return this.implementation.getEntry(collection, slug, path).then(loadedEntry => return this.implementation.getEntry(collection, slug, path).then(loadedEntry =>
this.entryWithFormat(collection, slug)( this.entryWithFormat(
collection,
slug,
)(
createEntry(collection.get('name'), slug, loadedEntry.file.path, { createEntry(collection.get('name'), slug, loadedEntry.file.path, {
raw: loadedEntry.data, raw: loadedEntry.data,
label, label,

View File

@ -237,9 +237,4 @@ const mapDispatchToProps = {
logoutUser, logoutUser,
}; };
export default hot(module)( export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(translate()(App)));
connect(
mapStateToProps,
mapDispatchToProps,
)(translate()(App)),
);

View File

@ -83,7 +83,4 @@ const mapDispatchToProps = {
traverseCollectionCursor: actionTraverseCollectionCursor, traverseCollectionCursor: actionTraverseCollectionCursor,
}; };
export default connect( export default connect(mapStateToProps, mapDispatchToProps)(EntriesCollection);
mapStateToProps,
mapDispatchToProps,
)(EntriesCollection);

View File

@ -83,7 +83,4 @@ const mapDispatchToProps = {
clearSearch: actionClearSearch, clearSearch: actionClearSearch,
}; };
export default connect( export default connect(mapStateToProps, mapDispatchToProps)(EntriesSearch);
mapStateToProps,
mapDispatchToProps,
)(EntriesSearch);

View File

@ -464,26 +464,23 @@ function mapStateToProps(state, ownProps) {
}; };
} }
export default connect( export default connect(mapStateToProps, {
mapStateToProps, changeDraftField,
{ changeDraftFieldValidation,
changeDraftField, loadEntry,
changeDraftFieldValidation, loadEntries,
loadEntry, loadDeployPreview,
loadEntries, loadLocalBackup,
loadDeployPreview, retrieveLocalBackup,
loadLocalBackup, persistLocalBackup,
retrieveLocalBackup, deleteLocalBackup,
persistLocalBackup, createDraftFromEntry,
deleteLocalBackup, createEmptyDraft,
createDraftFromEntry, discardDraft,
createEmptyDraft, persistEntry,
discardDraft, deleteEntry,
persistEntry, updateUnpublishedEntryStatus,
deleteEntry, publishUnpublishedEntry,
updateUnpublishedEntryStatus, deleteUnpublishedEntry,
publishUnpublishedEntry, logoutUser,
deleteUnpublishedEntry, })(withWorkflow(translate()(Editor)));
logoutUser,
},
)(withWorkflow(translate()(Editor)));

View File

@ -325,11 +325,8 @@ const mapDispatchToProps = {
clearFieldErrors, clearFieldErrors,
}; };
const ConnectedEditorControl = connect( const ConnectedEditorControl = connect(mapStateToProps, mapDispatchToProps, null, {
mapStateToProps, withRef: false,
mapDispatchToProps, })(translate()(EditorControl));
null,
{ withRef: false },
)(translate()(EditorControl));
export default ConnectedEditorControl; export default ConnectedEditorControl;

View File

@ -348,7 +348,4 @@ const mapDispatchToProps = {
closeMediaLibrary: closeMediaLibraryAction, closeMediaLibrary: closeMediaLibraryAction,
}; };
export default connect( export default connect(mapStateToProps, mapDispatchToProps)(translate()(MediaLibrary));
mapStateToProps,
mapDispatchToProps,
)(translate()(MediaLibrary));

View File

@ -156,12 +156,9 @@ function mapStateToProps(state) {
return returnObj; return returnObj;
} }
export default connect( export default connect(mapStateToProps, {
mapStateToProps, loadUnpublishedEntries,
{ updateUnpublishedEntryStatus,
loadUnpublishedEntries, publishUnpublishedEntry,
updateUnpublishedEntryStatus, deleteUnpublishedEntry,
publishUnpublishedEntry, })(translate()(Workflow));
deleteUnpublishedEntry,
},
)(translate()(Workflow));

View File

@ -35,7 +35,10 @@ const runSerializer = (values, fields, method) => {
// Call recursively for fields within lists // Call recursively for fields within lists
if (nestedFields && List.isList(value)) { if (nestedFields && List.isList(value)) {
return acc.set(fieldName, value.map(val => runSerializer(val, nestedFields, method))); return acc.set(
fieldName,
value.map(val => runSerializer(val, nestedFields, method)),
);
} }
// Call recursively for fields within objects // Call recursively for fields within objects

View File

@ -21,7 +21,10 @@ describe('entries', () => {
}); });
it('should handle loaded entries', () => { it('should handle loaded entries', () => {
const entries = [{ slug: 'a', path: '' }, { slug: 'b', title: 'B' }]; const entries = [
{ slug: 'a', path: '' },
{ slug: 'b', title: 'B' },
];
expect( expect(
reducer(initialState, actions.entriesLoaded(Map({ name: 'posts' }), entries, 0)), reducer(initialState, actions.entriesLoaded(Map({ name: 'posts' }), entries, 0)),
).toEqual( ).toEqual(

View File

@ -51,13 +51,11 @@ export function createAssetProxy(value, fileObj, uploaded = false, privateUpload
currentBackend(state.config).getToken, currentBackend(state.config).getToken,
integration, integration,
); );
return provider return provider.upload(fileObj, privateUpload).then(
.upload(fileObj, privateUpload) response =>
.then( new AssetProxy(response.asset.url.replace(/^(https?):/, ''), null, true, response.asset),
response => () => new AssetProxy(value, fileObj, false),
new AssetProxy(response.asset.url.replace(/^(https?):/, ''), null, true, response.asset), );
() => new AssetProxy(value, fileObj, false),
);
} else if (privateUpload) { } else if (privateUpload) {
throw new Error('The Private Upload option is only available for Asset Store Integration'); throw new Error('The Private Upload option is only available for Asset Store Integration');
} }

View File

@ -30,7 +30,8 @@ export default class ImplicitAuthenticator {
document.location.protocol !== 'https:' && document.location.protocol !== 'https:' &&
// TODO: Is insecure localhost a bad idea as well? I don't think it is, since you are not actually // TODO: Is insecure localhost a bad idea as well? I don't think it is, since you are not actually
// sending the token over the internet in this case, assuming the auth URL is secure. // sending the token over the internet in this case, assuming the auth URL is secure.
(document.location.hostname !== 'localhost' && document.location.hostname !== '127.0.0.1') document.location.hostname !== 'localhost' &&
document.location.hostname !== '127.0.0.1'
) { ) {
return cb(new Error('Cannot authenticate over insecure protocol!')); return cb(new Error('Cannot authenticate over insecure protocol!'));
} }

View File

@ -38,7 +38,12 @@ function onKeyDown(event, change) {
.collapseToStartOf(newBlock); .collapseToStartOf(newBlock);
} }
const marks = [['b', 'bold'], ['i', 'italic'], ['s', 'strikethrough'], ['`', 'code']]; const marks = [
['b', 'bold'],
['i', 'italic'],
['s', 'strikethrough'],
['`', 'code'],
];
const [, markName] = marks.find(([key]) => isHotkey(`mod+${key}`, event)) || []; const [, markName] = marks.find(([key]) => isHotkey(`mod+${key}`, event)) || [];

View File

@ -10126,10 +10126,10 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
prettier@1.18.2: prettier@^1.19.1:
version "1.18.2" version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
pretty-format@^24.0.0, pretty-format@^24.3.0, pretty-format@^24.7.0, pretty-format@^24.9.0: pretty-format@^24.0.0, pretty-format@^24.3.0, pretty-format@^24.7.0, pretty-format@^24.9.0:
version "24.9.0" version "24.9.0"