-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Migrate source files to Typescript #1280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7111ae8
Add ts-nocheck rule to eslint
jgonet 78f1431
Remove d.ts files from package.json, run eslint when linting
jgonet 1f159f1
Remove unnecessary whitespace in .gitignore
jgonet 77f04b7
Add babel plugins to package.json
jgonet 0ee9469
Rename all files to ts/tsx extension and suppress TS & eslint errors
jgonet 191ae04
Reformat and disable eslint in declaration files
jgonet 90b1ac1
Add dist/ to packed dirs, add build & prepare command
jgonet 48a9040
Add explicit return typo to createHandler to not use private Handler …
jgonet 0f5dbde
Link to dist Swipeable and DrawerLayout to allow using scoped import
jgonet 846db9a
Add types files for Drawer and Swipeable
jgonet 0c842fa
Fix for TS being stubborn
jgonet 1e065cf
Typos
jgonet d18a50e
Add tsconfig to the example app
jgonet 1a0c075
Add package.json and podspec to exports
jgonet 9efac2f
Copy Eslint config to examples
jgonet 93332eb
Move Esling config file into correct location
jgonet f3a7a5a
Remove jest eslint plugin
jgonet f702efe
Add commands & eslint to Example
jgonet 0a5fda7
Remove Swipeable and DrawerLayout
jgonet 4f7e96c
Lint only project files
jgonet 195230e
Update eslint and TS config
jgonet 544b6d5
Update Travis config
jgonet 4592826
Temporarily remove some flow annotations
jgonet cf0e8b0
Fix flag in ts-check command
jgonet 5ba616f
Don't compile Examples in the root tsconfig
jgonet f25dcf4
Remove deleted files from package.json list
jgonet 85ca6ed
Fix missing path specifier
jgonet 314bb40
Remove exports, add subdir package.json
jgonet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,5 +55,4 @@ jsconfig.json | |
.vscode | ||
|
||
# TS | ||
|
||
dist/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"main": "../dist/src/components/DrawerLayout", | ||
"react-native": "../dist/src/components/DrawerLayout", | ||
"types": "../DrawerLayout.d.ts" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"main": "../dist/src/components/Swipeable", | ||
"react-native": "../dist/src/components/Swipeable", | ||
"types": "../Swipeable.d.ts" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"satya164" | ||
], | ||
"settings": { | ||
"react": { "version": "16" }, | ||
"import/resolver": { | ||
"babel-module": {} | ||
} | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"env": { "browser": true, "node": true, "jest/globals": true }, | ||
"plugins": ["jest"], | ||
"ignorePatterns": ["dist/**/*"], | ||
"rules": { | ||
"no-use-before-define": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"import/named": "off", | ||
"react/sort-comp": "off", | ||
"prefer-const": [ | ||
"error", | ||
{ | ||
"destructuring": "all" | ||
} | ||
], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "argsIgnorePattern": "^_" } | ||
], | ||
"@typescript-eslint/no-use-before-define": "error", | ||
"@typescript-eslint/ban-ts-comment": [ | ||
"error", | ||
{ | ||
// ↓ TODO ts-nocheck should be removed after transition to TS ↓ | ||
"ts-nocheck": "allow-with-description", | ||
"ts-ignore": "allow-with-description", | ||
"ts-expect-error": "allow-with-description" | ||
} | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
// TODO(TS) Remove after we migrate to TS entirely | ||
"paths": { | ||
"react-native-gesture-handler": [ | ||
"../../react-native-gesture-handler.d.ts" | ||
], | ||
"react-native-gesture-handler/Swipeable": ["../../Swipeable.d.ts"], | ||
"react-native-gesture-handler/DrawerLayout": ["../../DrawerLayout.d.ts"] | ||
}, | ||
"esModuleInterop": true, | ||
"jsx": "react-native", | ||
"lib": ["esnext"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "esnext", | ||
"allowJs": true, | ||
"noStrictGenericChecks": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitUseStrict": false, | ||
"noUnusedParameters": true, | ||
"noUnusedLocals": true, | ||
"outDir": "./dist" | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.tsx", "index.js"] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.