Skip to content

Commit 03df3d5

Browse files
committed
Dump things over to TypeScript (#159)
* Dump things over to TypeScript * Pass on eslint * Drop unecessary `git add` * Jest configuration to add jsdom that is no longer bundled * Fix up tests
1 parent 308d704 commit 03df3d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+18294
-10248
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.jest
22
.husky
33
jest.config.js
4+
*.log
5+
.DS_Store
6+
dist

.eslintrc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@babel/eslint-parser",
33
"extends": [
44
"eslint:recommended"
55
],
66
"env": {
77
"es6": true,
8-
"browser": true
8+
"browser": true,
9+
"jest/globals": true
910
},
1011
"parserOptions": {
1112
"sourceType": "module",
@@ -14,8 +15,14 @@
1415
}
1516
},
1617
"plugins": [
17-
"react"
18+
"react",
19+
"jest"
1820
],
21+
"settings": {
22+
"react": {
23+
"version": "detect"
24+
}
25+
},
1926
"rules": {
2027
"react/jsx-uses-vars": ["error"],
2128
"react/display-name": ["error"],
@@ -34,9 +41,13 @@
3441
},
3542
"overrides": [
3643
{
37-
"files": ["*.test.js"],
38-
"env": {
39-
"jest": true
44+
"files": [
45+
"**/*.ts?(x)"
46+
],
47+
"rules": {
48+
"no-unused-vars": [
49+
2
50+
]
4051
}
4152
}
4253
]

babel.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
'@babel/preset-env',
4+
'@babel/preset-react',
5+
'@babel/preset-typescript'
6+
]
7+
};

example/index.js renamed to example/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useRef } from 'react';
22
import ReactDOM from 'react-dom';
3-
import ColorPickr from '../src/colorpickr';
3+
import ColorPickr from '../src/colorpickr.tsx';
44

55
// Output fill that's outside of the react app.
66
const outputFill = document.getElementById('output-fill');

0 commit comments

Comments
 (0)