保存进度!

This commit is contained in:
2023-03-06 14:22:01 +08:00
parent bc7bc4c8ce
commit 6adbc5594c
7 changed files with 2897 additions and 138 deletions

View File

@@ -0,0 +1,42 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
Plugin: [
"@typescript-eslint", //typescript的语法检查插件
],
extends: "standard-with-typescript",
rules: { // 单项的语法检查规则
"no-console": "warn",
"quote-props": ["warn", "as-needed",],
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
indent: ["warn", 4,],
"no-unused-vars": "warn",
semi: ["error", "always",], // 控制行尾部分号
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
imports: "never",
exports: "never",
functions: "never",
},], // 数组和对象键值对最后一个逗号
"comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": ["error", "never",],
"no-undef-init": "error",
"no-invalid-this": "error",
"no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
// "comma-spacing": ["error", { "before": false, "after": true, },],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"@typescript-eslint/no-extra-semi": "off",
},
overrides: [
],
};

2482
code/ts-practice/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
{
"name": "code_test",
"version": "1.0.0",
"description": "用于测试前端的typescript代码",
"main": "index.ts",
"type": "module",
"scripts": {
"test": "ts-node-esm index.ts"
},
"author": "Kane",
"license": "ISC",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"eslint-config-standard-with-typescript": "^34.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-promise": "^6.1.1",
"typescript": "^4.9.5"
},
"dependencies": {
"axios": "^1.3.4"
}
}

View File

@@ -0,0 +1,2 @@
//

View File

@@ -0,0 +1,18 @@
import axios from "axios";
const service = axios.create({
baseURL: "",
timeout: 10000,
});
service.interceptors.request.use(
(config) =>
{
return config;
},
(error) =>
{
return Promise.reject(error);
}
);

View File

@@ -0,0 +1,35 @@
/*
* @Author: Kane
* @Date: 2023-03-03 11:21:43
* @LastEditors: Kane
* @FilePath: /code_test/tsconfig.json
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
{
"compilerOptions": {
"strict": true,
"target": "ES2015",
"module": "CommonJS",
"esModuleInterop": true,
"lib": [
"ESNext",
],
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
],
},
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"*.d.ts",
],
"exclude": [
"./node_modules",
],
"compileOnSave": true,
}