Skip to content

Commit ebe5c09

Browse files
committed
Rewrite using TS & hooks. Cleanup bunch of stuff, use preconstruct for building
1 parent 1ca0041 commit ebe5c09

21 files changed

+546
-736
lines changed

.babelrc.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ module.exports = {
1111
},
1212
],
1313
'@babel/react',
14+
'@babel/typescript',
1415
],
1516
plugins: [
16-
['@babel/proposal-class-properties', { loose }],
17-
['@babel/proposal-object-rest-spread', { loose }],
18-
['transform-react-remove-prop-types', { mode: 'unsafe-wrap' }],
19-
'macros',
17+
'@babel/transform-runtime',
18+
[
19+
'@babel/proposal-object-rest-spread',
20+
{ loose },
21+
'parcel seems to add some plugins in a way which conflicts with this one defined here (causing a duplicate)',
22+
],
2023
],
2124
};

.eslintrc

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,24 @@
33
"eslint:recommended",
44
"prettier",
55
"plugin:prettier/recommended",
6-
"plugin:react/recommended"
6+
"plugin:react/recommended",
7+
"plugin:@typescript-eslint/recommended"
78
],
8-
"parser": "babel-eslint",
9+
"parser": "@typescript-eslint/parser",
910
"env": {
11+
"browser": true,
1012
"node": true
1113
},
12-
"plugins": ["react"],
14+
"plugins": ["react", "@typescript-eslint"],
1315
"rules": {
14-
"no-unused-vars": ["error", { "varsIgnorePattern": "^_" }]
16+
"@typescript-eslint/explicit-function-return-type": "off",
17+
"@typescript-eslint/no-empty-function": "off",
18+
"@typescript-eslint/no-explicit-any": "off",
19+
"react/prop-types": "off"
1520
},
1621
"settings": {
1722
"react": {
1823
"version": "detect"
1924
}
20-
},
21-
"globals": {
22-
"process": false
23-
},
24-
"overrides": [
25-
{
26-
"files": ["src/*.js", "example/index.js"],
27-
"env": {
28-
"browser": true,
29-
"node": false
30-
}
31-
},
32-
{
33-
"files": "**/__tests__/**",
34-
"env": {
35-
"jest": true
36-
}
37-
},
38-
{
39-
"files": ["scripts", "*.macro.js"],
40-
"env": {
41-
"node": true
42-
}
43-
}
44-
]
25+
}
4526
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ example/.nojekyll
55
dist
66
node_modules
77
yarn.lock
8+
.cache

.lintstagedrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"*.js": [
2+
"*.{js,ts,tsx}": [
33
"prettier --write",
44
"eslint --fix --no-ignore .*.js"
55
],
6-
"*.md": ["prettier --write"]
6+
"*.{md,json}": ["prettier --write"]
77
}

example/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<head>
3-
<meta charset="utf-8">
3+
<meta charset="utf-8" />
44
<style>
55
body {
66
background: #ccc;
@@ -17,5 +17,5 @@
1717
<body>
1818
<h1>React &lt;TextareaAutosize /&gt; component</h1>
1919
<div id="main"></div>
20-
<script src="bundle.js"></script>
20+
<script src="./index.tsx"></script>
2121
</body>

example/index.js

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

0 commit comments

Comments
 (0)