The sources of the project follows this structure:
/src
/app
/{domain}
/actions.ts
/actions.spec.ts
import { InjectedFormikProps, withFormik } from 'formik'; | |
import * as React from 'react'; | |
import * as Yup from 'yup'; | |
interface FormValues { | |
login: string; | |
} | |
interface FormProps { | |
login?: string; |
module.exports = { | |
root: true, // make to not take in any user specified rules in parent folders | |
parser: 'babel-eslint', | |
extends: ['airbnb', 'prettier', 'prettier/flowtype', 'prettier/react'], | |
env: { | |
browser: true, | |
node: true, | |
jest: true, | |
}, | |
plugins: ['flowtype'], |
import {Action, ActionCreator, Dispatch} from 'redux'; | |
import {ThunkAction} from 'redux-thunk'; | |
// Redux action | |
const reduxAction: ActionCreator<Action> = (text: string) => { | |
return { | |
type: SET_TEXT, | |
text | |
}; | |
}; |
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
Follow the steps below to use babel
together with ts-loader
so that you can
use emotion
(or any other Babel plugin) in your React and TypeScript project.
$ create-react-app my-app --scripts-version=react-scripts-ts
prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
---|---|---|---|
What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
What it does | Runs the code (string) through prettier then eslint --fix . The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb . |
How to use it | Either calling the function in your code or via [prettier-eslint-cli ](https://github.co |
このドキュメントでは、DeployGateを社内で運用して効率的に業務フローを回すための実践的なアイデアやTipsをまとめて行きます。
基本的にはCIで実行するスクリプトの最後に、curl
コマンドでDpeloyGate Restful APIを使ってビルドしたバイナリをPOST
するだけでOK。
Circle CIであれば、circle.ymlのdeployment
の最後に以下のように追記するだけで、ビルド成功時に自動的にバイナリをアップロードして配信することができる。
このとき、curlの-F "file=@xxx"
の@
はよく忘れている人がいるので、忘れないようにしてください。(curlでのファイル名の指定方法です)
import { call, put, takeLatest } from 'redux-saga/effects' | |
import axios from 'axios' | |
export const FETCH_API_REQUEST = 'FETCH_API_REQUEST'; | |
export const FETCH_API_SUCCESS = 'FETCH_API_SUCCESS'; | |
export const FETCH_API_FAIL = 'FETCH_API_FAIL'; | |
// Moved api call into own function (for easy test swapping) | |
export function fetchFromApi(userId) { | |
return axios.get(`/users/${userId}`) |