pull/8/head
zjx0905 2020-07-27 12:29:58 +08:00
parent 08d1995503
commit cff801a8bf
14 changed files with 61 additions and 5054 deletions

View File

@ -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"
]
}

View File

@ -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"
}
}

18
.eslintrc.js Normal file
View File

@ -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',
},
};

View File

@ -1,10 +0,0 @@
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"semi": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"parser": "typescript"
}

View File

@ -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

View File

@ -1,16 +0,0 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-modules-commonjs"
]
}

14
babel.config.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'@babel/preset-typescript',
],
plugins: ['@babel/plugin-transform-typescript'],
};

6
husky.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
hooks: {
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
'pre-commit': 'lint-staged',
},
};

8
jest.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};

3
lint-staged.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
'*.{ts,tsx}': ['eslint --fix', 'git add'],
};

View File

@ -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/plugin-transform-runtime": "^7.10.5",
"@babel/preset-typescript": "^7.10.4",
"@babel/runtime": "^7.10.5",
"@types/jest": "^26.0.5",
@ -63,12 +48,13 @@
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.2.5",
"jest": "^26.1.0",
"prettier": "^2.0.5",
"jest": "^26.1.0",
"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"
}
}

View File

@ -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';

View File

@ -2,9 +2,6 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": [
"es2020"
],
"declaration": true,
"declarationDir": "./types",
"sourceMap": true,

4947
yarn.lock

File diff suppressed because it is too large Load Diff