forked from forem/forem
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added prettier for front-end code formatting. * Prettier runs on JSX too now Modified supported extensions for running prettier. * Added some documentation in the README about prettier, husky and lint-staged. * package-lock.json updated. * Keep lint-staged package-manager agnostic (forem#196) * Remove code-breaking comma
- Loading branch information
1 parent
f0b3e65
commit d67c243
Showing
10 changed files
with
3,228 additions
and
97 deletions.
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module.exports = { | ||
"extends": "airbnb-base/legacy", | ||
"env": { | ||
"browser": true, | ||
extends: ['airbnb-base/legacy', 'prettier'], | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
}, | ||
"plugins": [ | ||
"ignore-erb" | ||
] | ||
env: { | ||
browser: true, | ||
}, | ||
plugins: ['ignore-erb'], | ||
}; |
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,2 @@ | ||
package.json | ||
package-lock.json |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"waderyan.nodejs-extension-pack", | ||
"esbenp.prettier-vscode", | ||
"donjayamanne.git-extension-pack" | ||
] | ||
} |
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,12 +1,24 @@ | ||
module.exports = { | ||
"extends": "airbnb", | ||
"settings": { | ||
"react": { | ||
"pragma": "h" | ||
extends: ['airbnb', 'prettier'], | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
}, | ||
settings: { | ||
react: { | ||
pragma: 'h', | ||
}, | ||
}, | ||
"env": { | ||
"jest": true, | ||
"browser": true, | ||
env: { | ||
jest: true, | ||
browser: true, | ||
}, | ||
plugins: ['import'], | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: ['**/*.test.js', '**/*.test.jsx', '**/*.stories.jsx'], | ||
}, | ||
], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
import { h } from 'preact'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { linkTo } from '@storybook/addon-links'; | ||
|
||
import { Button, Welcome } from '@storybook/react/demo'; | ||
|
||
storiesOf('Welcome', module).add('to Storybook', () => ( | ||
<Welcome showApp={linkTo('Button')} /> | ||
)); | ||
|
||
storiesOf('Button', module) | ||
.add('with text', () => ( | ||
<Button onClick={action('clicked')}>Hello Button</Button> | ||
)) | ||
.add('with some emoji', () => ( | ||
<Button onClick={action('clicked')}>😀 😎 👍 💯</Button> | ||
)); |
Oops, something went wrong.