mirror of
https://github.com/simoneb/axios-hooks.git
synced 2025-12-08 21:25:56 +00:00
chore: repo maintenance
This commit is contained in:
parent
bb8a0e43fb
commit
1349b1d404
12
.eslintrc
12
.eslintrc
@ -1,14 +1,14 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "babel-eslint",
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"plugins": ["import", "react-hooks"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
@ -18,8 +18,6 @@
|
||||
"Promise": true
|
||||
},
|
||||
"rules": {
|
||||
"valid-jsdoc": 2,
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn"
|
||||
"valid-jsdoc": 2
|
||||
}
|
||||
}
|
||||
|
||||
23
.github/workflows/node.js.yml
vendored
23
.github/workflows/node.js.yml
vendored
@ -3,24 +3,23 @@ name: Node.js CI
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm test -- --coverage
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm test -- --coverage
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
792
package-lock.json
generated
792
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -24,12 +24,10 @@
|
||||
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir cjs",
|
||||
"build:es": "babel src --out-dir es",
|
||||
"build": "run-p build:*",
|
||||
"clean": "rimraf cjs es coverage",
|
||||
"commit": "npx git-cz",
|
||||
"clean": "rimraf cjs es",
|
||||
"format": "prettier --write \"{src,test}/**/*.{js?(x),md,ts?(x)}\"",
|
||||
"lint": "eslint src test",
|
||||
"prepare": "npm run clean && npm run build",
|
||||
"prepublishOnly": "npm run build",
|
||||
"release": "standard-version",
|
||||
"pretest": "cp ./test/index.test.jsx ./test/index.test.tsx && cp ./test/index.test.ssr.jsx ./test/index.test.ssr.tsx",
|
||||
"test": "jest --no-cache"
|
||||
@ -60,14 +58,13 @@
|
||||
"axios": "0.21.1",
|
||||
"babel-eslint": "10.1.0",
|
||||
"cross-env": "7.0.3",
|
||||
"cz-conventional-changelog": "3.3.0",
|
||||
"eslint": "7.17.0",
|
||||
"eslint-config-prettier": "7.1.0",
|
||||
"eslint-plugin-import": "2.22.1",
|
||||
"eslint-plugin-prettier": "3.3.0",
|
||||
"eslint-plugin-react": "7.22.0",
|
||||
"eslint-plugin-react-hooks": "4.2.0",
|
||||
"husky": "5.0.6",
|
||||
"husky": "4.3.6",
|
||||
"jest": "26.6.3",
|
||||
"lint-staged": "10.5.3",
|
||||
"npm-run-all": "4.1.5",
|
||||
@ -88,13 +85,8 @@
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js?(x),md}": [
|
||||
"{src,test}/**/*.{js?(x),md}": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
src/index.d.ts
vendored
10
src/index.d.ts
vendored
@ -30,9 +30,15 @@ export interface ConfigureOptions {
|
||||
}
|
||||
|
||||
export interface UseAxios {
|
||||
<TResponse = any, TError = any>(config: AxiosRequestConfig | string, options?: Options): [
|
||||
<TResponse = any, TError = any>(
|
||||
config: AxiosRequestConfig | string,
|
||||
options?: Options
|
||||
): [
|
||||
ResponseValues<TResponse, TError>,
|
||||
(config?: AxiosRequestConfig, options?: RefetchOptions) => AxiosPromise<TResponse>
|
||||
(
|
||||
config?: AxiosRequestConfig,
|
||||
options?: RefetchOptions
|
||||
) => AxiosPromise<TResponse>
|
||||
]
|
||||
|
||||
loadCache(data: any[]): void
|
||||
|
||||
@ -8,5 +8,10 @@
|
||||
},
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user