Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
[IMPROVE] Add TypeScript (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoevanp committed Apr 1, 2022
1 parent 6a16d3b commit 7e6ff4b
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 8 deletions.
19 changes: 14 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@
"no-sequences": "off"
},
"settings": {
"react": {
"pragma": "h",
"pragmaFrag": "Fragment",
"version": "detect"
}
"import/resolver": {
"node": {
"extensions": [
".js",
".ts",
".tsx"
]
}
},
"react": {
"pragma": "h",
"pragmaFrag": "Fragment",
"version": "detect"
}
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"stylelint": "^13.6.1",
"stylelint-order": "^4.1.0",
"svg-loader": "^0.0.2",
"ts-loader": "^8.3.0",
"typescript": "^4.6.3",
"url-loader": "^4.1.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "node",
"target": "es2018",
"outDir": "./dist",
"allowJs": true,
"checkJs": false,

"noImplicitAny": true,
},
"exclude": [
"./node_modules",
"./build"
]
}
18 changes: 18 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = (env, argv) => [
extensions: [
'.js',
'.jsx',
'.ts',
'.tsx',
],
alias: {
react: 'preact/compat',
Expand Down Expand Up @@ -52,6 +54,13 @@ module.exports = (env, argv) => [
'babel-loader',
],
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: [
'/node_modules/',
],
},
{
test: /\.svg$/,
use: [
Expand Down Expand Up @@ -217,6 +226,8 @@ module.exports = (env, argv) => [
extensions: [
'.js',
'.jsx',
'.ts',
'.tsx',
],
alias: {
react: 'preact/compat',
Expand Down Expand Up @@ -259,6 +270,13 @@ module.exports = (env, argv) => [
},
],
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: [
'/node_modules/',
],
},
],
},
},
Expand Down
35 changes: 32 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3834,7 +3834,7 @@ braces@^2.3.1, braces@^2.3.2:
split-string "^3.0.2"
to-regex "^3.0.1"

braces@^3.0.1, braces@~3.0.2:
braces@^3.0.1, braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
Expand Down Expand Up @@ -5917,7 +5917,7 @@ endent@^2.0.1:
fast-json-parse "^1.0.3"
objectorarray "^1.0.5"

enhanced-resolve@^4.1.1, enhanced-resolve@^4.3.0:
enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.1, enhanced-resolve@^4.3.0:
version "4.5.0"
resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz"
integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==
Expand Down Expand Up @@ -10002,6 +10002,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.2"

micromatch@^4.0.0:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
dependencies:
braces "^3.0.2"
picomatch "^2.3.1"

micromatch@^4.0.2, micromatch@^4.0.4:
version "4.0.4"
resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz"
Expand Down Expand Up @@ -11198,6 +11206,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz"
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==

picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pidtree@^0.3.0:
version "0.3.1"
resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz"
Expand Down Expand Up @@ -13219,7 +13232,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.2.1, semver@^7.3.2:
semver@^7.2.1, semver@^7.3.2, semver@^7.3.4:
version "7.3.5"
resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
Expand Down Expand Up @@ -14473,6 +14486,17 @@ ts-essentials@^2.0.3:
resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-2.0.12.tgz"
integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==

ts-loader@^8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-8.3.0.tgz#83360496d6f8004fab35825279132c93412edf33"
integrity sha512-MgGly4I6cStsJy27ViE32UoqxPTN9Xly4anxxVyaIWR+9BGxboV4EyJBGfR3RePV7Ksjj3rHmPZJeIt+7o4Vag==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^4.0.0"
loader-utils "^2.0.0"
micromatch "^4.0.0"
semver "^7.3.4"

ts-pnp@^1.1.6:
version "1.2.0"
resolved "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.2.0.tgz"
Expand Down Expand Up @@ -14593,6 +14617,11 @@ typedarray@^0.0.6:
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^4.6.3:
version "4.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==

uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz"
Expand Down

0 comments on commit 7e6ff4b

Please sign in to comment.