-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3b9575
commit 3fe472a
Showing
11 changed files
with
481 additions
and
43 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.yml] | ||
indent_size = 2 |
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,11 @@ | ||
.eslintrc.js | ||
.prettierrc.js | ||
.stylelintrc.js | ||
babel.config.js | ||
jest.config.js | ||
postcss.config.js | ||
tailwind.config.js | ||
**/*.d.ts | ||
app/javascript/gql/generated.ts | ||
app/javascript/shared/i18n.ts | ||
config/**/*.js |
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,64 @@ | ||
module.exports = { | ||
globals: { | ||
I18n: 'readonly', | ||
google: 'readonly', | ||
global: 'readonly', | ||
YT: 'readonly', | ||
betterplaceOverlayConfig: 'readonly', | ||
dataLayer: 'readonly', | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
root: true, | ||
plugins: ['@typescript-eslint', 'react', 'prettier'], | ||
env: { | ||
browser: true, | ||
|
||
node: true, | ||
es6: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
rules: { | ||
'import/no-unassigned-import': 0, | ||
'import/no-named-as-default-member': 0, | ||
'import/order': 0, | ||
'react/prop-types': 0, | ||
'no-empty': ['error', { allowEmptyCatch: true }], | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
extendDefaults: true, | ||
types: { | ||
'{}': false, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
args: 'all', | ||
ignoreRestSiblings: true, | ||
varsIgnorePattern: '^[_A-Z]', | ||
argsIgnorePattern: '^_*', | ||
caughtErrors: 'none', | ||
}, | ||
], | ||
'react/jsx-uses-react': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
}, | ||
} |
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,6 @@ | ||
dist/**/* | ||
node_modules | ||
coverage | ||
.history | ||
app/javascript/gql/generated.ts | ||
app/javascript/shared/i18n.ts |
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,18 @@ | ||
module.exports = { | ||
arrowParens: 'always', | ||
printWidth: 120, | ||
quoteProps: 'consistent', | ||
semi: false, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
endOfLine: 'lf', | ||
overrides: [ | ||
{ | ||
files: ['*.json', '*.yml', '*.md'], | ||
options: { | ||
tabWidth: 2, | ||
}, | ||
}, | ||
], | ||
} |
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,4 +1,5 @@ | ||
import React from "react"; | ||
import React from 'react' | ||
|
||
type SampleProps = { foo: string }; | ||
export const Sample = ({ foo }: SampleProps) => <div>{foo}</div>; | ||
type SampleProps = { foo: string } | ||
export const Sample = ({ foo }: SampleProps) => <div>{foo}qweqweqweqweqweqw</div> | ||
// whatever |
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,48 +1,42 @@ | ||
import React from 'react'; | ||
import './button.css'; | ||
import React from 'react' | ||
import './button.css' | ||
|
||
interface ButtonProps { | ||
/** | ||
* Is this the principal call to action on the page? | ||
*/ | ||
primary?: boolean; | ||
primary?: boolean | ||
/** | ||
* What background color to use | ||
*/ | ||
backgroundColor?: string; | ||
backgroundColor?: string | ||
/** | ||
* How large should the button be? | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
size?: 'small' | 'medium' | 'large' | ||
/** | ||
* Button contents | ||
*/ | ||
label: string; | ||
label: string | ||
/** | ||
* Optional click handler | ||
*/ | ||
onClick?: () => void; | ||
onClick?: () => void | ||
} | ||
|
||
/** | ||
* Primary UI component for user interaction | ||
*/ | ||
export const Button = ({ | ||
primary = false, | ||
size = 'medium', | ||
backgroundColor, | ||
label, | ||
...props | ||
}: ButtonProps) => { | ||
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; | ||
export const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props }: ButtonProps) => { | ||
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary' | ||
return ( | ||
<button | ||
type="button" | ||
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')} | ||
style={{ backgroundColor }} | ||
{...props} | ||
> | ||
{label} | ||
{label + 'ooo'} | ||
</button> | ||
); | ||
}; | ||
) | ||
} |
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
Oops, something went wrong.