Skip to content

Commit d74a4da

Browse files
committed
Switch to typescript
1 parent 9b8f1fc commit d74a4da

29 files changed

Lines changed: 376 additions & 61 deletions

.babelrc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
[
44
"@babel/preset-env",
55
{
6-
"exclude": [
7-
"transform-regenerator"
8-
]
6+
"exclude": ["transform-regenerator"]
97
}
10-
]
8+
],
9+
"@babel/preset-typescript"
1110
]
12-
}
11+
}

.eslintrc.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
env:
22
browser: true
33
es6: true
4+
parser: '@typescript-eslint/parser'
5+
parserOptions:
6+
ecmaVersion: 2020
7+
sourceType: module
8+
project: './tsconfig.json'
49
extends:
5-
- airbnb-base
10+
- airbnb-typescript/base
611
- prettier
7-
#parser: babel
12+
plugins:
13+
- '@typescript-eslint'
814
globals:
915
Atomics: readonly
1016
SharedArrayBuffer: readonly
11-
parserOptions:
12-
ecmaVersion: 11
13-
sourceType: module
1417
rules:
1518
no-console: off
1619
import/prefer-default-export: off

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
lib
3-
.idea
3+
.idea
4+
.vscode

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"cosmiconfig"
4+
]
5+
}

package-lock.json

Lines changed: 183 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"react-codegen": "lib/bin.js"
88
},
99
"scripts": {
10-
"prepublish": "babel src --out-dir lib --copy-files",
11-
"watch": "babel --watch src --out-dir lib --source-maps inline --copy-files",
12-
"lint": "eslint src --ext .js"
10+
"prepublish": "npm run build",
11+
"build": "babel src --out-dir lib --copy-files --extensions \".ts\"",
12+
"watch": "npm run build -- --watch --source-maps inline",
13+
"lint": "eslint src --ext .ts"
1314
},
1415
"husky": {
1516
"hooks": {
@@ -20,9 +21,9 @@
2021
"dependencies": {
2122
"@babel/generator": "^7.10.1",
2223
"@babel/parser": "^7.10.1",
23-
"@babel/template": "^7.10.1",
2424
"@babel/traverse": "^7.10.1",
2525
"@babel/types": "^7.10.1",
26+
"@babel/template": "^7.10.1",
2627
"chalk": "^4.0.0",
2728
"console-clear": "^1.1.1",
2829
"cosmiconfig": "^6.0.0",
@@ -40,16 +41,23 @@
4041
"@babel/cli": "^7.10.1",
4142
"@babel/core": "^7.10.1",
4243
"@babel/preset-env": "^7.10.1",
44+
"@babel/preset-typescript": "^7.10.1",
45+
"@types/babel-generator": "^6.25.3",
4346
"@types/babel-traverse": "^6.25.5",
4447
"@types/babel-types": "^7.0.7",
48+
"@types/babel__generator": "^7.6.1",
4549
"@types/fs-extra": "^9.0.1",
4650
"@types/inquirer": "^6.5.0",
4751
"@types/yargs": "^15.0.5",
52+
"@typescript-eslint/eslint-plugin": "^3.1.0",
53+
"@typescript-eslint/parser": "^3.1.0",
4854
"eslint": "^6.8.0",
4955
"eslint-config-airbnb-base": "^14.1.0",
56+
"eslint-config-airbnb-typescript": "^8.0.2",
5057
"eslint-config-prettier": "^6.11.0",
5158
"eslint-plugin-import": "^2.20.2",
52-
"husky": "^4.2.5"
59+
"husky": "^4.2.5",
60+
"typescript": "^3.9.5"
5361
},
5462
"keywords": [
5563
"react",
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import path from 'path';
22

3-
import { getAppRoot, getConfig } from '../utils';
4-
import { getStylesExtension } from '../utils/getStylesExtension';
3+
import { getAppRoot, getConfig, getStylesExtension } from '../utils';
4+
import { StyleFormats } from '../types/types';
55

6-
export const STYLE_FORMATS = ['CSS', 'SCSS', 'SASS', 'Less', 'Stylus'];
6+
export const STYLE_FORMATS: StyleFormats[] = ['CSS', 'SCSS', 'SASS', 'Less', 'Stylus'];
77
export const APP_ROOT = getAppRoot();
88
export const ROOT = path.dirname(require.main.filename);
99
export const CONFIG = getConfig();

0 commit comments

Comments
 (0)