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
| /// YOUR CODE | |
| const data = { | |
| "id": 168409, | |
| "gid": "gid://quiqup/CourierShift/168409", | |
| "start_time": "2016-08-31T18:15:00.000+01:00", | |
| "end_time": "2017-08-31T18:15:00.000+01:00", | |
| "checked_in_at": null, | |
| "accepted_at": null, | |
| "push_sent_at": null, | |
| "wiw_site": { |
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
| yarn add typescript typings ts-loade tslint tslint-react -D | |
| Typings | |
| yarn add @types/enzyme @types/jest @types/react @types/react-native -D | |
| Some helpers: | |
| yarn add concurrently cpx rimraf -D | |
| "@types/storybook__addon-actions": "^3.0.1", |
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
| module.exports = { | |
| getTransformModulePath() { | |
| return require.resolve('react-native-typescript-transformer'); | |
| }, | |
| getSourceExts() { | |
| return ['ts', 'tsx']; | |
| } | |
| } |
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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "skipLibCheck": true, // fix for duplicate identifier | |
| "lib": [ | |
| "es2015", | |
| "es2017", | |
| "dom", | |
| "esnext.asynciterable" | |
| ], | |
| "target": "es2015", |
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
| watchman watch-del-all | |
| npm start -- --reset-cache |
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
| yarn add --dev typescript | |
| yarn add --dev react-native-typescript-transformer | |
| yarn tsc --init --pretty --jsx react | |
| touch rn-cli.config.js | |
| yarn add --dev @types/react @types/react-native |
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
| { | |
| "extends": ["tslint:recommended", "tslint-config-prettier", "tslint-react"], | |
| "defaultSeverity": "error", | |
| "jsRules": {}, | |
| "rules": { | |
| "quotemark": [true, "single", "jsx-double"], | |
| "ordered-imports": false, | |
| "object-literal-sort-keys": false, | |
| "arrow-parens": false, | |
| "no-console": [false], |
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
| "jest": { | |
| "preset": "react-native", | |
| "moduleFileExtensions": [ | |
| "ts", | |
| "tsx", | |
| "js" | |
| ], | |
| "transform": { | |
| "^.+\\.(js)$": "<rootDir>/node_modules/babel-jest", | |
| "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js" |
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
| import React from 'react' | |
| import App from './App' | |
| import renderer from 'react-test-renderer' | |
| describe('App', () => { | |
| it('should render', () => { | |
| const tree = renderer.create(<App/>).toJSON() | |
| expect(tree).toMatchSnapshot() | |
| }) | |
| }) |
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
| { "scripts": { "precommit": "pretty-quick --staged" } } |
OlderNewer