-
Notifications
You must be signed in to change notification settings - Fork 87
Prettier #10
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
Merged
Prettier #10
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
34f92ca
Add Prettier + ESLint AirBnB
17c4d16
Run Prettier
cd8d4b7
Drop rules we don't need. Adjust paths in package.json
6614445
Only .js files.
40d5d45
Add serviceworker and Jest env to eslint.
eccba63
Remove a few unneed lines and have the linting tests run by CircleCI
justafish 15336ad
Run separate lint and unit jobs with CircleCI
justafish 3d4ff0b
Set maximum warnings to 0
justafish 0798617
Cleanup for rules.
de74c79
No more console.log
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 hidden or 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 hidden or 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,20 @@ | ||
{ | ||
"extends": [ | ||
"airbnb", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest": true, | ||
"serviceworker": true | ||
}, | ||
"rules": { | ||
"react/jsx-filename-extension": [1, { "extensions": [".js"] }], | ||
"jsx-a11y/anchor-is-valid": [ "error", { | ||
"aspects": [ "noHref" ] | ||
}], | ||
"no-param-reassign": [2, { "props": false }] | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
# testing | ||
/coverage | ||
/reports | ||
|
||
# production | ||
/build | ||
|
This file contains hidden or 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,6 @@ | ||
{ | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains hidden or 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 hidden or 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,48 @@ | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; | ||
|
||
import routes from './routes'; | ||
|
||
import Home from './components/05_pages/Home/Home'; | ||
import NoMatch from './NoMatch'; | ||
|
||
import normalize from './styles/normalize'; // eslint-disable-line no-unused-vars | ||
import base from './styles/base'; // eslint-disable-line no-unused-vars | ||
|
||
class App extends Component { | ||
componentDidMount() { | ||
window.history.replaceState(null, null, '/'); | ||
} | ||
render() { | ||
return ( | ||
<Router> | ||
<div> | ||
<ul> | ||
<li> | ||
<Link to="/">Home</Link> | ||
</li> | ||
<li> | ||
<Link to="/admin/people/permissions">Permissions</Link> | ||
</li> | ||
<li> | ||
<Link to="/admin/appearance">Appearance</Link> | ||
</li> | ||
<li> | ||
<Link to="/node/add">Content</Link> | ||
</li> | ||
</ul> | ||
|
||
<hr /> | ||
|
||
<Route exact path="/" component={Home} /> | ||
{Object.keys(routes).map(route => ( | ||
<Route path={route} component={routes[route]} key={route} /> | ||
))} | ||
<Route component={NoMatch} /> | ||
</div> | ||
</Router> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,22 @@ | ||
import { Component } from 'react'; | ||
import { shape, string } from 'prop-types'; | ||
|
||
import routes from './routes'; | ||
|
||
const NoMatch = class NoMatch extends Component { | ||
static propTypes = { | ||
location: shape({ | ||
pathname: string.isRequired, | ||
}).isRequired, | ||
}; | ||
componentWillReceiveProps(nextProps) { | ||
if (!Object.keys(routes).includes(nextProps.location.pathname)) { | ||
window.location = window.location.href; | ||
} | ||
} | ||
render() { | ||
return null; | ||
} | ||
}; | ||
|
||
export default NoMatch; |
File renamed without changes.
13 changes: 6 additions & 7 deletions
13
...ents/05_pages/Permissions/Permissions.jsx → ...nents/05_pages/Permissions/Permissions.js
This file contains hidden or 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,18 +1,17 @@ | ||
import React from 'react'; | ||
import { css } from 'emotion'; | ||
|
||
const styles = { | ||
title: css` | ||
text-decoration: underline; | ||
`, | ||
}; | ||
|
||
const Permissions = () => ( | ||
<div> | ||
<h1 className={styles.title}>Permissions</h1> | ||
<p>This will be the permissions page.</p> | ||
</div> | ||
); | ||
|
||
const styles = { | ||
title: css` | ||
text-decoration: underline; | ||
`, | ||
}; | ||
|
||
export default Permissions; | ||
|
This file contains hidden or 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 hidden or 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,8 @@ | ||
import Permissions from './components/05_pages/Permissions/Permissions'; | ||
|
||
// @todo Share this with Drupal | ||
const routes = { | ||
'/admin/people/permissions': Permissions, | ||
}; | ||
|
||
export default routes; |
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.
I love trailing comma all!