保存进度!

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

430
.gitignore vendored
View File

@ -1,3 +1,186 @@
# ---> Java
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
# ---> Vue
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
# TODO: where does this rule come from?
docs/_book
# TODO: where does this rule come from?
test/
# ---> Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
# ---> VisualStudio # ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
@ -398,175 +581,146 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
# ---> VisualStudioCode # ---> JetBrains
.vscode/* # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
!.vscode/settings.json # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code # User-specific stuff
.history/ .idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Built Visual Studio Code Extensions # AWS User-specific
*.vsix .idea/**/aws.xml
# ---> Java # Generated files
# Compiled class file .idea/**/contentModel.xml
*.class
# Log file # Sensitive or high-churn files
*.log .idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# BlueJ files # Gradle
*.ctxt .idea/**/gradle.xml
.idea/**/libraries
# Mobile Tools for Java (J2ME) # Gradle and Maven with auto-import
.mtj.tmp/ # When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# Package Files # # CMake
*.jar cmake-build-*/
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # Mongo Explorer plugin
hs_err_pid* .idea/**/mongoSettings.xml
replay_pid*
# ---> Node # File-based project format
# Logs *.iws
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html) # IntelliJ
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json out/
# Runtime data # mpeltonen/sbt-idea plugin
pids .idea_modules/
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover # JIRA plugin
lib-cov atlassian-ide-plugin.xml
# Coverage directory used by tools like istanbul # Cursive Clojure plugin
coverage .idea/replstate.xml
*.lcov
# nyc test coverage # SonarLint plugin
.nyc_output .idea/sonarlint/
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) # Crashlytics plugin (for Android Studio and IntelliJ)
.grunt com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Bower dependency directory (https://bower.io/) # Editor-based Rest Client
bower_components .idea/httpRequests
# node-waf configuration # Android studio 3.1+ serialized cache file
.lock-wscript .idea/caches/build_file_checksums.ser
# Compiled binary addons (https://nodejs.org/api/addons.html) # ---> Eclipse
build/Release .metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# Dependency directories # External tool builders
node_modules/ .externalToolBuilders/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/) # Locally stored "Eclipse launch configurations"
web_modules/ *.launch
# TypeScript cache # PyDev specific (Python IDE for Eclipse)
*.tsbuildinfo *.pydevproject
# Optional npm cache directory # CDT-specific (C/C++ Development Tooling)
.npm .cproject
# Optional eslint cache # CDT- autotools
.eslintcache .autotools
# Optional stylelint cache # Java annotation processor (APT)
.stylelintcache .factorypath
# Microbundle cache # PDT-specific (PHP Development Tools)
.rpt2_cache/ .buildpath
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history # sbteclipse plugin
.node_repl_history .target
# Output of 'npm pack' # Tern plugin
*.tgz .tern-project
# Yarn Integrity file # TeXlipse plugin
.yarn-integrity .texlipse
# dotenv environment variable files # STS (Spring Tool Suite)
.env .springBeans
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/) # Code Recommenders
.cache .recommenders/
.parcel-cache
# Next.js build output # Annotation Processing
.next .apt_generated/
out .apt_generated_test/
# Nuxt.js build / generate output # Scala IDE specific (Scala & Java development for Eclipse)
.nuxt .cache-main
dist .scala_dependencies
.worksheet
# Gatsby files # Uncomment this line if you wish to ignore the project description file.
.cache/ # Typically, this file would be tracked if it contains build/dependency configurations:
# Comment in the public line in if your project uses Gatsby and not Next.js #.project
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
target
target/*

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,
}