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

Updates the prettier command and applies prettier fixes #1780

Merged
merged 4 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
26 changes: 14 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"version": "0.2.0",
"configurations": [{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."]
}]
}
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."]
}
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ rebuild-deps:

.PHONY: format
format:
@npx prettier --write {desktop,lib,sass}/{**/,*}.{js,json,jsx,sass}
@npx prettier --ignore-path .gitignore --write "**/*.{js,jsx,json,sass}"

.PHONY: lint
lint:
@npx eslint --ext .js --ext .jsx lib
@npx eslint --ignore-path .gitignore --ext .js --ext .jsx lib
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Other Changes

- Updated dependencies [#1759](https://github.com/Automattic/simplenote-electron/pull/1759)
- Applied prettier formatting to all files [#1780](https://github.com/Automattic/simplenote-electron/pull/1780)

## [v1.13.0]

Expand Down
37 changes: 10 additions & 27 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"output": "release",
"buildResources": "resources"
},
"files": [
"desktop",
"dist",
"shared"
],
"files": ["desktop", "dist", "shared"],
"mac": {
"icon": "./resources/images/app-icon.icns",
"category": "public.app-category.social-networking",
Expand All @@ -24,7 +20,8 @@
"icon": "./resources/images/dmg-icon.icns",
"iconSize": 150,
"background": "./resources/images/dmg-background.png",
"contents": [{
"contents": [
{
"x": 480,
"y": 240,
"type": "link",
Expand All @@ -40,12 +37,10 @@
"win": {
"icon": "resources/images/simplenote.ico",
"artifactName": "Simplenote-win-${version}-${arch}.${ext}",
"target": [{
"target": [
{
"target": "nsis",
"arch": [
"ia32",
"x64"
]
"arch": ["ia32", "x64"]
}
]
},
Expand All @@ -60,31 +55,19 @@
"target": [
{
"target": "AppImage",
"arch": [
"x64",
"ia32"
]
"arch": ["x64", "ia32"]
},
{
"target": "deb",
"arch": [
"x64",
"ia32"
]
"arch": ["x64", "ia32"]
},
{
"target": "rpm",
"arch": [
"x64",
"ia32"
]
"arch": ["x64", "ia32"]
},
{
"target": "tar.gz",
"arch": [
"x64",
"ia32"
]
"arch": ["x64", "ia32"]
}
],
"synopsis": "The simplest way to keep notes",
Expand Down
5 changes: 4 additions & 1 deletion lib/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ export const App = connect(

if (isSmallScreen !== prevProps.isSmallScreen) {
this.setState({
isNoteOpen: Boolean(this.props.appState.note && (settings.focusModeEnabled || !isSmallScreen)),
isNoteOpen: Boolean(
this.props.appState.note &&
(settings.focusModeEnabled || !isSmallScreen)
),
});
}
}
Expand Down
5 changes: 1 addition & 4 deletions lib/auth/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,4 @@ const mapStateToProps = state => ({
hasLoginError: hasLoginError(state),
});

export default connect(
mapStateToProps,
mapDispatchToProps
)(Auth);
export default connect(mapStateToProps, mapDispatchToProps)(Auth);
5 changes: 1 addition & 4 deletions lib/dialogs/settings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,4 @@ const mapDispatchToProps = dispatch => ({
},
});

export default connect(
null,
mapDispatchToProps
)(SettingsDialog);
export default connect(null, mapDispatchToProps)(SettingsDialog);
5 changes: 1 addition & 4 deletions lib/dialogs/settings/panels/display.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,4 @@ const mapDispatchToProps = dispatch => {
};
};

export default connect(
mapStateToProps,
mapDispatchToProps
)(DisplayPanel);
export default connect(mapStateToProps, mapDispatchToProps)(DisplayPanel);
5 changes: 1 addition & 4 deletions lib/dialogs/settings/panels/tools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,4 @@ const mapDispatchToProps = dispatch => {
};
};

export default connect(
null,
mapDispatchToProps
)(ToolsPanel);
export default connect(null, mapDispatchToProps)(ToolsPanel);
2 changes: 1 addition & 1 deletion lib/flux/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export const actionMap = new ActionMap({
appState: { selectedNoteId, note, notes },
} = getState();

if ( selectedNoteId === noteId ) {
if (selectedNoteId === noteId) {
return note.data;
}

Expand Down
7 changes: 2 additions & 5 deletions lib/note-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class NoteDetail extends Component {
<SimplenoteCompactLogo />
</div>
) : (
<div className='note-detail'>
<div className="note-detail">
{previewingMarkdown && (
<div
ref={this.storePreview}
Expand Down Expand Up @@ -256,7 +256,4 @@ const mapDispatchToProps = {
onNotePrinted: () => setShouldPrintNote({ shouldPrint: false }),
};

export default connect(
mapStateToProps,
mapDispatchToProps
)(NoteDetail);
export default connect(mapStateToProps, mapDispatchToProps)(NoteDetail);
5 changes: 1 addition & 4 deletions lib/note-editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,4 @@ const mapDispatchToProps = dispatch => ({
setEditorMode: args => dispatch(setEditorMode(args)),
});

export default connect(
mapStateToProps,
mapDispatchToProps
)(NoteEditor);
export default connect(mapStateToProps, mapDispatchToProps)(NoteEditor);
5 changes: 1 addition & 4 deletions lib/search-bar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,4 @@ const mapDispatchToProps = (dispatch, { noteBucket, onNoteOpened }) => ({

SearchBar.displayName = 'SearchBar';

export default connect(
mapStateToProps,
mapDispatchToProps
)(SearchBar);
export default connect(mapStateToProps, mapDispatchToProps)(SearchBar);
5 changes: 1 addition & 4 deletions lib/search-field/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,4 @@ const mapDispatchToProps = dispatch => ({
onSearchFocused: () => dispatch(setSearchFocus({ searchFocus: false })),
});

export default connect(
mapStateToProps,
mapDispatchToProps
)(SearchField);
export default connect(mapStateToProps, mapDispatchToProps)(SearchField);
5 changes: 1 addition & 4 deletions lib/tag-email-tooltip/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,4 @@ EmailToolTip.propTypes = {
openShareDialog: PropTypes.func.isRequired,
};

export default connect(
null,
mapDispatchToProps
)(EmailToolTip);
export default connect(null, mapDispatchToProps)(EmailToolTip);
5 changes: 1 addition & 4 deletions lib/tag-field/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,4 @@ export class TagField extends Component {
}
}

export default connect(
null,
{ updateNoteTags }
)(TagField);
export default connect(null, { updateNoteTags })(TagField);
5 changes: 1 addition & 4 deletions lib/tag-list/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,4 @@ const mapDispatchToProps = dispatch => ({
trashTag: arg => dispatch(trashTag(arg)),
});

export default connect(
mapStateToProps,
mapDispatchToProps
)(TagList);
export default connect(mapStateToProps, mapDispatchToProps)(TagList);
5 changes: 1 addition & 4 deletions lib/tag-suggestions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,4 @@ const mapDispatchToProps = dispatch => ({
},
});

export default connect(
mapStateToProps,
mapDispatchToProps
)(TagSuggestions);
export default connect(mapStateToProps, mapDispatchToProps)(TagSuggestions);
4 changes: 2 additions & 2 deletions lib/utils/filter-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default function filterNotes(state, notesArray = null) {
matchesTag(note) &&
matchesSearch(get(note, ['data', 'content']));

notesToFilter.forEach( note => {
notesToFilter.forEach(note => {
if (!matchesFilter(note)) {
return;
}
Expand All @@ -144,7 +144,7 @@ export default function filterNotes(state, notesArray = null) {
} else {
otherMatches.push(note);
}
} );
});

return titleMatches.concat(otherMatches);
}