Skip to content

Commit da6bc1d

Browse files
satya164osdnk
authored andcommitted
chore: migrate codebase to typescript (#32)
1 parent 6bfd2db commit da6bc1d

File tree

7 files changed

+432
-179
lines changed

7 files changed

+432
-179
lines changed

.eslintrc.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module.exports = {
33
browser: true,
44
es6: true,
55
},
6-
parser: 'babel-eslint',
76
extends: [
87
'eslint:recommended',
98
'plugin:react/recommended',
109
'eslint-config-prettier',
1110
'eslint-config-prettier/react',
1211
],
12+
plugins: ['react', 'prettier'],
1313
settings: {
1414
react: {
1515
pragma: 'React',
@@ -23,14 +23,31 @@ module.exports = {
2323
ecmaVersion: 2018,
2424
sourceType: 'module',
2525
},
26-
plugins: ['react', 'prettier'],
2726
rules: {
2827
'max-len': ['off', 80],
2928
'no-undef': 'off',
3029
'linebreak-style': ['error', 'unix'],
31-
32-
'react/prop-types': 'off',
33-
3430
'prettier/prettier': 'error',
31+
'react/prop-types': 'off',
3532
},
36-
}
33+
overrides: [
34+
{
35+
files: ['*.js'],
36+
parser: 'babel-eslint',
37+
},
38+
{
39+
files: ['*.ts', '*.tsx'],
40+
parser: '@typescript-eslint/parser',
41+
plugins: ['@typescript-eslint/eslint-plugin'],
42+
rules: {
43+
'@typescript-eslint/no-unused-vars': [
44+
'error',
45+
{ argsIgnorePattern: '^_' },
46+
],
47+
48+
'no-dupe-class-members': 'off',
49+
'no-unused-vars': 'off',
50+
},
51+
},
52+
],
53+
};

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
'singleQuote': true,
3+
'tabWidth': 2,
4+
'trailingComma': 'es5',
5+
'useTabs': false,
6+
'semi': false,
7+
}

package.json

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"description": "Bottom sheet component",
55
"main": "lib/commonjs/index.js",
66
"module": "lib/module/index.js",
7-
"react-native": "src/index.js",
8-
"types": "reanimated-bottom-sheet.d.ts",
7+
"react-native": "lib/module/index.js",
8+
"types": "lib/typescript/index.d.ts",
99
"scripts": {
1010
"test": "echo \"Error: no test specified\" && exit 1",
11-
"lint": "eslint .",
11+
"lint": "eslint --ext .js,.ts,.tsx .",
12+
"typescript": "tsc --noEmit",
1213
"release": "release-it",
1314
"prepare": "bob build"
1415
},
@@ -39,21 +40,28 @@
3940
},
4041
"devDependencies": {
4142
"@commitlint/config-conventional": "^7.5.0",
42-
"@react-native-community/bob": "^0.3.3",
43+
"@react-native-community/bob": "^0.4.1",
44+
"@types/react": "^16.8.14",
45+
"@types/react-native": "^0.57.50",
46+
"@typescript-eslint/eslint-plugin": "^1.7.0",
47+
"@typescript-eslint/parser": "^1.7.0",
4348
"babel-eslint": "^10.0.1",
4449
"commitlint": "^7.5.2",
4550
"conventional-changelog-cli": "^2.0.12",
46-
"eslint": "^5.15.1",
47-
"eslint-config-prettier": "^4.1.0",
51+
"eslint": "^5.16.0",
52+
"eslint-config-prettier": "^4.2.0",
4853
"eslint-plugin-prettier": "^3.0.1",
4954
"eslint-plugin-react": "^7.12.4",
5055
"husky": "^1.3.1",
51-
"prettier": "^1.16.4",
52-
"react-native-reanimated": "^1.0.0-alpha.12",
53-
"release-it": "^10.4.0"
56+
"prettier": "^1.17.0",
57+
"react-native-gesture-handler": "^1.1.0",
58+
"react-native-reanimated": "^1.0.1",
59+
"release-it": "^10.4.0",
60+
"typescript": "^3.4.5"
5461
},
5562
"husky": {
5663
"hooks": {
64+
"pre-commit": "yarn lint && yarn typescript",
5765
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
5866
}
5967
},
@@ -62,7 +70,8 @@
6270
"output": "lib",
6371
"targets": [
6472
"commonjs",
65-
"module"
73+
"module",
74+
"typescript"
6675
]
6776
}
6877
}

reanimated-bottom-sheet.d.ts

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

0 commit comments

Comments
 (0)