Skip to content

Commit

Permalink
chore: migrate codebase to typescript (osdnk#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 authored and osdnk committed May 8, 2019
1 parent 6bfd2db commit da6bc1d
Show file tree
Hide file tree
Showing 7 changed files with 432 additions and 179 deletions.
29 changes: 23 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module.exports = {
browser: true,
es6: true,
},
parser: 'babel-eslint',
extends: [
'eslint:recommended',
'plugin:react/recommended',
'eslint-config-prettier',
'eslint-config-prettier/react',
],
plugins: ['react', 'prettier'],
settings: {
react: {
pragma: 'React',
Expand All @@ -23,14 +23,31 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'prettier'],
rules: {
'max-len': ['off', 80],
'no-undef': 'off',
'linebreak-style': ['error', 'unix'],

'react/prop-types': 'off',

'prettier/prettier': 'error',
'react/prop-types': 'off',
},
}
overrides: [
{
files: ['*.js'],
parser: 'babel-eslint',
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],

'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
},
],
};
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
'singleQuote': true,
'tabWidth': 2,
'trailingComma': 'es5',
'useTabs': false,
'semi': false,
}
29 changes: 19 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"description": "Bottom sheet component",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.js",
"types": "reanimated-bottom-sheet.d.ts",
"react-native": "lib/module/index.js",
"types": "lib/typescript/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint .",
"lint": "eslint --ext .js,.ts,.tsx .",
"typescript": "tsc --noEmit",
"release": "release-it",
"prepare": "bob build"
},
Expand Down Expand Up @@ -39,21 +40,28 @@
},
"devDependencies": {
"@commitlint/config-conventional": "^7.5.0",
"@react-native-community/bob": "^0.3.3",
"@react-native-community/bob": "^0.4.1",
"@types/react": "^16.8.14",
"@types/react-native": "^0.57.50",
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"babel-eslint": "^10.0.1",
"commitlint": "^7.5.2",
"conventional-changelog-cli": "^2.0.12",
"eslint": "^5.15.1",
"eslint-config-prettier": "^4.1.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"husky": "^1.3.1",
"prettier": "^1.16.4",
"react-native-reanimated": "^1.0.0-alpha.12",
"release-it": "^10.4.0"
"prettier": "^1.17.0",
"react-native-gesture-handler": "^1.1.0",
"react-native-reanimated": "^1.0.1",
"release-it": "^10.4.0",
"typescript": "^3.4.5"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn typescript",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
Expand All @@ -62,7 +70,8 @@
"output": "lib",
"targets": [
"commonjs",
"module"
"module",
"typescript"
]
}
}
47 changes: 0 additions & 47 deletions reanimated-bottom-sheet.d.ts

This file was deleted.

Loading

0 comments on commit da6bc1d

Please sign in to comment.