Skip to content

Commit 6455009

Browse files
authored
Merge pull request #8 from coded-bear/develop
updated packages, formatting, refactor
2 parents ec9b373 + 43e223d commit 6455009

36 files changed

+4974
-5043
lines changed

.babelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"],
3-
"comments": false,
4-
"compact": true
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"comments": false,
4+
"compact": true
55
}

.eslintrc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"env": {
3-
"browser": true
4-
},
5-
"parser": "@babel/eslint-parser",
6-
"parserOptions": {
7-
"ecmaFeatures": {
8-
"jsx": true
2+
"env": {
3+
"browser": true
94
},
10-
"sourceType": "module"
11-
},
12-
"settings": {
13-
"react": {
14-
"version": "detect"
5+
"parser": "@babel/eslint-parser",
6+
"parserOptions": {
7+
"ecmaFeatures": {
8+
"jsx": true
9+
},
10+
"sourceType": "module"
11+
},
12+
"settings": {
13+
"react": {
14+
"version": "detect"
15+
}
16+
},
17+
"extends": [
18+
"eslint:recommended",
19+
"plugin:react/recommended",
20+
"plugin:react-hooks/recommended",
21+
"plugin:import/recommended",
22+
"plugin:prettier/recommended",
23+
"prettier"
24+
],
25+
"rules": {
26+
"no-unused-vars": "off",
27+
"react/prop-types": "off"
1528
}
16-
},
17-
"extends": [
18-
"eslint:recommended",
19-
"plugin:react/recommended",
20-
"plugin:react-hooks/recommended",
21-
"plugin:import/recommended",
22-
"plugin:prettier/recommended",
23-
"prettier"
24-
],
25-
"rules": {
26-
"no-unused-vars": "off",
27-
"react/prop-types": "off"
28-
}
2929
}

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
.eslintrc
66
.prettierignore
77
.prettierrc
8-
webpack.config.js
8+
webpack.config.js

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# dependencies
22
/node_modules
3+
yarn.lock
4+
package-lock.json
5+
6+
# logs
7+
logs
8+
*.log
39

410
# builds
511
/lib

.prettierrc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
2-
"arrowParens": "always",
3-
"printWidth": 120,
4-
"semi": true,
5-
"singleQuote": true,
6-
"tabWidth": 2,
7-
"trailingComma": "es5",
8-
"useTabs": false
2+
"endOfLine": "lf",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 4,
6+
"printWidth": 100,
7+
"trailingComma": "all",
8+
"arrowParens": "avoid",
9+
"useTabs": false,
10+
"bracketSpacing": true,
11+
"bracketSameLine": false
912
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Łukasz Warchoł
3+
Copyright (c) 2022 Łukasz Warchoł
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ import React, { useState } from 'react';
1919
import OtpField from 'react-otp-field';
2020

2121
const App = () => {
22-
const [value, setValue] = useState('');
22+
const [value, setValue] = useState('');
2323

24-
return (
25-
<OtpField
26-
value={value}
27-
onChange={setValue}
28-
numInputs={6}
29-
onChangeRegex={/^([0-9]{0,})$/}
30-
autoFocus
31-
separator={<span>-</span>}
32-
isTypeNumber
33-
inputProps={{ className: 'otp-field__input', disabled: false }}
34-
/>
35-
);
24+
return (
25+
<OtpField
26+
value={value}
27+
onChange={setValue}
28+
numInputs={6}
29+
onChangeRegex={/^([0-9]{0,})$/}
30+
autoFocus
31+
separator={<span>-</span>}
32+
isTypeNumber
33+
inputProps={{ className: 'otp-field__input', disabled: false }}
34+
/>
35+
);
3636
};
3737
```
3838

@@ -120,11 +120,11 @@ const App = () => {
120120
<td>Type number for inputs.</td>
121121
</tr>
122122
<tr>
123-
<td>hasErrored</td>
123+
<td>hasError</td>
124124
<td>Boolean</td>
125125
<td>false</td>
126126
<td>false</td>
127-
<td>Error class 'otp-field--has-errored' for otp-field component.</td>
127+
<td>Error class 'otp-field--has-error' for otp-field component.</td>
128128
</tr>
129129
<tr>
130130
<td>inputProps</td>

0 commit comments

Comments
 (0)