-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add prettier code formatting #377
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3818cea
Add prettier, husky and lint-staged
jason-fox 289d721
Run `npm run prettier` to format files - whitespace changes only.
jason-fox 4099678
Add exception for single/double quote to pass linter
jason-fox 5137c40
Husky Update
jason-fox 2d474ba
Amend tab width
jason-fox 7e183c7
Rerun prettier across all files
jason-fox 6119ef6
Replace ^ with ~ in dependencies
jason-fox f9a9b68
Create Prettier Config
jason-fox 9a8fe5b
Rerun prettier - 120 width
jason-fox d98de8e
Expand maxlen for tests only
jason-fox 190ff29
Merge branch 'master' into feature/prettier
jason-fox 5c57098
Re-running prettier with no trailing comma.
jason-fox 9fd06aa
Resolve conflicts
jason-fox 22fc6cc
Add command
jason-fox f90c273
Re-run prettier at 120 width
jason-fox 6f5a131
Remove package-lock.json
jason-fox 7657825
Add prettier ignore overrides
jason-fox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"singleQuote": true, | ||
"parser": "flow", | ||
"printWidth": 120, | ||
"trailingComma": "none", | ||
"tabWidth": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,6 @@ config.mqtt = { | |
config.device = { | ||
id: 'myDeviceId', | ||
apikey: '1234' | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
var metas = document.getElementsByTagName('meta'); | ||
var i; | ||
if (navigator.userAgent.match(/iPhone/i)) { | ||
for (i=0; i<metas.length; i++) { | ||
if (metas[i].name == "viewport") { | ||
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | ||
for (i = 0; i < metas.length; i++) { | ||
if (metas[i].name == 'viewport') { | ||
metas[i].content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0'; | ||
} | ||
} | ||
} | ||
document.addEventListener("gesturestart", gestureStart, false); | ||
document.addEventListener('gesturestart', gestureStart, false); | ||
} | ||
function gestureStart() { | ||
for (i=0; i<metas.length; i++) { | ||
if (metas[i].name == "viewport") { | ||
metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6"; | ||
for (i = 0; i < metas.length; i++) { | ||
if (metas[i].name == 'viewport') { | ||
metas[i].content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6'; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./lib/iotagent-json'); | ||
module.exports = require('./lib/iotagent-json'); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is 117 chars long. I wonder why prettier has changed it if printWidth is 120...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably prettier picks up on the
\n
and breaks at that pointThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit weird... but ok.
NTC