1.1.3
parent
08d1995503
commit
cff801a8bf
20
.babelrc
20
.babelrc
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"presets": [
|
||||
"@babel/preset-typescript",
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"ie >= 11"
|
||||
]
|
||||
},
|
||||
"modules": false,
|
||||
"loose": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-optional-chaining"
|
||||
]
|
||||
}
|
27
.eslintrc
27
.eslintrc
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* @Author: early-autumn
|
||||
* @Date: 2020-03-06 20:35:23
|
||||
* @LastEditors: early-autumn
|
||||
* @LastEditTime: 2020-04-17 12:39:07
|
||||
*/
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"prettier"
|
||||
],
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-namespace": "off"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:prettier/recommended',
|
||||
],
|
||||
plugins: ['@typescript-eslint', 'prettier'],
|
||||
env: {
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/no-namespace': 'off',
|
||||
},
|
||||
};
|
10
.prettierrc
10
.prettierrc
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"printWidth": 120,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always",
|
||||
"parser": "typescript"
|
||||
}
|
|
@ -4,8 +4,8 @@ cache:
|
|||
directories:
|
||||
- node_modules
|
||||
install:
|
||||
- npm install
|
||||
- yarn install
|
||||
script:
|
||||
- npm run prettier
|
||||
- npm run lint
|
||||
- npm run coverage
|
||||
- yarn prettier
|
||||
- yarn lint
|
||||
- yarn coverage
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-optional-chaining",
|
||||
"@babel/plugin-transform-modules-commonjs"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
node: 'current',
|
||||
},
|
||||
},
|
||||
],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: ['@babel/plugin-transform-typescript'],
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
hooks: {
|
||||
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
|
||||
'pre-commit': 'lint-staged',
|
||||
},
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
module.exports = {
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'*.{ts,tsx}': ['eslint --fix', 'git add'],
|
||||
};
|
24
package.json
24
package.json
|
@ -11,26 +11,13 @@
|
|||
],
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"lint": "eslint --ext ts --fix src __tests__",
|
||||
"prettier": "prettier --write --config .prettierrc \"{src,__tests__}/**/*.{js,ts}\"",
|
||||
"lint": "eslint 'src/**/*.{js,ts,tsx}'",
|
||||
"format": "eslint --fix 'src/**/*.{js,ts,tsx}'",
|
||||
"test": "jest",
|
||||
"test:watch": "yarn test -- --watch",
|
||||
"test:cov": "yarn test -- --coverage",
|
||||
"coverage": "yarn test:cov --coverageReporters=text-lcov | coveralls"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "yarn prettier && yarn lint && yarn test:cov && git add ."
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"globals": {
|
||||
"ts-jest": {
|
||||
"babelConfig": "test/.babelrc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zjx0905/axios-miniprogram.git"
|
||||
|
@ -49,10 +36,8 @@
|
|||
"homepage": "https://github.com/zjx0905/axios-miniprogram#readme",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.5",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
|
||||
"@babel/plugin-transform-runtime": "^7.10.5",
|
||||
"@babel/preset-env": "^7.10.4",
|
||||
"@babel/preset-typescript": "^7.10.4",
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@types/jest": "^26.0.5",
|
||||
|
@ -64,11 +49,12 @@
|
|||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^26.1.0",
|
||||
"prettier": "^2.0.5",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-typescript2": "^0.27.1",
|
||||
"ts-jest": "^26.1.3",
|
||||
"typescript": "^3.9.7"
|
||||
"typescript": "^3.9.7",
|
||||
"@babel/plugin-transform-typescript": "^7.10.3",
|
||||
"lint-staged": "^10.2.11"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
/*
|
||||
* @Author: early-autumn
|
||||
* @Date: 2020-03-06 20:40:30
|
||||
* @LastEditors: early-autumn
|
||||
* @LastEditTime: 2020-04-28 13:18:34
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import nodeResolve from 'rollup-plugin-node-resolve';
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": [
|
||||
"es2020"
|
||||
],
|
||||
"declaration": true,
|
||||
"declarationDir": "./types",
|
||||
"sourceMap": true,
|
||||
|
|
Loading…
Reference in New Issue