Skip to content

Commit ba21767

Browse files
committed
fix: linter
1 parent a573f06 commit ba21767

File tree

10 files changed

+233
-166
lines changed

10 files changed

+233
-166
lines changed

.eslintrc

Lines changed: 0 additions & 34 deletions
This file was deleted.

.eslintrc.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'prettier'],
4+
extends: [
5+
'airbnb',
6+
'plugin:import/errors',
7+
'plugin:import/warnings',
8+
'plugin:prettier/recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'prettier/@typescript-eslint',
11+
],
12+
rules: {
13+
'linebreak-style': 0,
14+
'import/prefer-default-export': 0,
15+
'prettier/prettier': 0,
16+
'import/extensions': 0,
17+
'no-use-before-define': 0,
18+
'import/no-unresolved': 0,
19+
'import/no-extraneous-dependencies': 0,
20+
'no-shadow': 0,
21+
'react/prop-types': 0,
22+
'react/jsx-filename-extension': [
23+
2,
24+
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
25+
],
26+
'jsx-a11y/no-noninteractive-element-interactions': 0,
27+
'react/jsx-props-no-spreading': 0,
28+
'@typescript-eslint/explicit-function-return-type': [
29+
'error',
30+
{
31+
allowExpressions: true,
32+
},
33+
],
34+
},
35+
}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"printWidth": 80,
3-
"semi": false,
43
"singleQuote": true,
4+
"semi": false,
55
"trailingComma": "es5",
66
"tabWidth": 2
77
}

.travis.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,22 @@
4141
"babel-eslint": "^10.0.3",
4242
"cross-env": "^7.0.2",
4343
"eslint": "^6.8.0",
44+
"eslint-config-airbnb": "^18.2.1",
4445
"eslint-config-prettier": "^6.7.0",
4546
"eslint-config-standard": "^14.1.0",
4647
"eslint-config-standard-react": "^9.2.0",
4748
"eslint-plugin-import": "^2.18.2",
49+
"eslint-plugin-jsx-a11y": "^6.5.1",
4850
"eslint-plugin-node": "^11.0.0",
4951
"eslint-plugin-prettier": "^3.1.1",
5052
"eslint-plugin-promise": "^4.2.1",
51-
"eslint-plugin-react": "^7.17.0",
53+
"eslint-plugin-react": "^7.29.4",
54+
"eslint-plugin-react-hooks": "^4.4.0",
5255
"eslint-plugin-standard": "^4.0.1",
5356
"gh-pages": "^2.2.0",
5457
"microbundle-crl": "^0.13.10",
5558
"npm-run-all": "^4.1.5",
56-
"prettier": "^2.0.4",
59+
"prettier": "^2.6.2",
5760
"react": "^16.13.1",
5861
"react-dom": "^16.13.1",
5962
"react-scripts": "^3.4.1",

src/.eslintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/Button.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ export const Button: React.FC<ButtonProps> = (props) => {
7979
circle,
8080
fullWidth,
8181
padding,
82+
style,
83+
children,
8284
...rest
8385
} = props
8486

8587
const wrappedBackgroundColor = backgroundColor && new Color(backgroundColor)
8688

87-
if (wrappedBackgroundColor) console.log(wrappedBackgroundColor.lightness())
88-
8989
const computedBackgroundColor = new Color(
9090
backgroundColor ||
9191
(primary
@@ -122,13 +122,21 @@ export const Button: React.FC<ButtonProps> = (props) => {
122122
disabled={disabled === true}
123123
circle={circle === true}
124124
padding={padding}
125-
style={{ width: props.fullWidth ? '100%' : 'unset', ...props.style }}
125+
style={{ width: fullWidth ? '100%' : 'unset', ...style }}
126126
>
127-
<div
128-
style={{ padding: props.padding === 'none' ? 'unset' : '12px 16px' }}
129-
>
130-
{props.children}
127+
<div style={{ padding: padding === 'none' ? 'unset' : '12px 16px' }}>
128+
{children}
131129
</div>
132130
</ButtonContainer>
133131
)
134132
}
133+
134+
Button.defaultProps = {
135+
backgroundColor: undefined,
136+
hoverColor: undefined,
137+
primary: false,
138+
disabled: false,
139+
circle: false,
140+
fullWidth: false,
141+
padding: 'normal',
142+
}

src/index.test.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)