From 11d2c7c82d936c6d3b675e2affc812a3d3d29eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=96=AF=EF=BC=88xiaosi=EF=BC=89?= <1531733886@qq.com> Date: Sat, 24 Dec 2022 20:38:07 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=F0=9F=93=A6=EF=B8=8F=20update=20eslin?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 6 ++++-- package.json | 27 +++++++++++++------------- pnpm-lock.yaml | 38 +++++++++++++++++++------------------ tests/HelloWorld.spec.ts | 2 +- tests/TsxComponents.spec.ts | 2 +- tsconfig.json | 28 +++++++++++---------------- tsconfig.node.json | 10 ++++++++++ 7 files changed, 61 insertions(+), 52 deletions(-) create mode 100644 tsconfig.node.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 246e9c6e..52f8872e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - } + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true + }, + "eslint.validate": ["json", "javascript", "typescript", "typescriptreact", "javascriptreact"] } diff --git a/package.json b/package.json index b977f562..34570f69 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "name": "xsadmin", - "version": "1.6.0", + "version": "1.6.1", "author": { "name": "小斯斯", "email": "1531733886@qq.com", "url": "https://github.com/SuperCuteXiaoSi" }, + "license": "MIT", + "engines": { + "node": "14.x || 16.x" + }, "scripts": { "dev": "vite", "build": "vite build", @@ -21,7 +25,7 @@ "test:run": "vitest run", "test:gzip": "http-server dist --cors --gzip -c-1", "test:br": "http-server dist --cors --brotli -c-1", - "lint:eslint": "eslint \"{src,mock,build}/**/*.{vue,ts,js,tsx,jsx}\" --fix", + "lint:eslint": "eslint \"{src,mock,build}/**/*.{vue,ts,js,tsx,jsx}\" package.json --fix", "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,css,scss,vue,ts,tsx,jsx,html,md}\"", "lint:stylelint": "stylelint --fix scss \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:pretty": "pretty-quick --staged", @@ -65,9 +69,9 @@ "devDependencies": { "@ehutch79/vite-eslint": "^0.0.1", "@esbuild-kit/cjs-loader": "^2.4.1", - "@jsxiaosi/commitlint-config": "^0.0.13", - "@jsxiaosi/eslint-config-prettier": "^0.0.13", - "@jsxiaosi/eslint-config-vue": "^0.0.13", + "@jsxiaosi/commitlint-config": "^0.0.14", + "@jsxiaosi/eslint-config-prettier": "^0.0.14", + "@jsxiaosi/eslint-config-vue": "^0.0.14", "@types/core-js": "^2.5.5", "@types/crypto-js": "^4.1.1", "@types/intro.js": "^5.1.0", @@ -88,6 +92,7 @@ "czg": "^1.4.1", "echarts-wordcloud": "^2.1.0", "eslint": "^8.30.0", + "eslint-plugin-jsonc": "^2.5.0", "http-server": "^14.1.1", "husky": "^8.0.2", "jsdom": "^20.0.3", @@ -123,7 +128,6 @@ "vue-tsc": "^1.0.16", "xlsx": "^0.18.5" }, - "license": "MIT", "pnpm": { "peerDependencyRules": { "ignoreMissing": [ @@ -135,11 +139,6 @@ ] } }, - "config": { - "commitizen": { - "path": "node_modules/cz-git" - } - }, "resolutions": { "bin-wrapper": "npm:bin-wrapper-china" }, @@ -167,7 +166,9 @@ "prettier --write" ] }, - "engines": { - "node": "14.x || 16.x" + "config": { + "commitizen": { + "path": "node_modules/cz-git" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49928742..5cd4bf41 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,9 +7,9 @@ specifiers: '@ehutch79/vite-eslint': ^0.0.1 '@element-plus/icons-vue': ^2.0.10 '@esbuild-kit/cjs-loader': ^2.4.1 - '@jsxiaosi/commitlint-config': ^0.0.13 - '@jsxiaosi/eslint-config-prettier': ^0.0.13 - '@jsxiaosi/eslint-config-vue': ^0.0.13 + '@jsxiaosi/commitlint-config': ^0.0.14 + '@jsxiaosi/eslint-config-prettier': ^0.0.14 + '@jsxiaosi/eslint-config-vue': ^0.0.14 '@logicflow/core': ^1.1.31 '@logicflow/extension': ^1.1.31 '@types/core-js': ^2.5.5 @@ -38,6 +38,7 @@ specifiers: element-plus: ^2.2.27 es6-promise: ^4.2.8 eslint: ^8.30.0 + eslint-plugin-jsonc: ^2.5.0 http-server: ^14.1.1 husky: ^8.0.2 i18next: ^22.4.6 @@ -127,9 +128,9 @@ dependencies: devDependencies: '@ehutch79/vite-eslint': 0.0.1 '@esbuild-kit/cjs-loader': 2.4.1 - '@jsxiaosi/commitlint-config': 0.0.13_czg@1.4.1+husky@8.0.2 - '@jsxiaosi/eslint-config-prettier': 0.0.13_l5rdqc4k22455lce6ocqroldia - '@jsxiaosi/eslint-config-vue': 0.0.13_lzzuuodtsqwxnvqeq4g4likcqa + '@jsxiaosi/commitlint-config': 0.0.14_czg@1.4.1+husky@8.0.2 + '@jsxiaosi/eslint-config-prettier': 0.0.14_l5rdqc4k22455lce6ocqroldia + '@jsxiaosi/eslint-config-vue': 0.0.14_lzzuuodtsqwxnvqeq4g4likcqa '@types/core-js': 2.5.5 '@types/crypto-js': 4.1.1 '@types/intro.js': 5.1.0 @@ -150,6 +151,7 @@ devDependencies: czg: 1.4.1 echarts-wordcloud: 2.1.0_echarts@5.4.1 eslint: 8.30.0 + eslint-plugin-jsonc: 2.5.0_eslint@8.30.0 http-server: 14.1.1 husky: 8.0.2 jsdom: 20.0.3 @@ -2636,10 +2638,10 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@jsxiaosi/commitlint-config/0.0.13_czg@1.4.1+husky@8.0.2: + /@jsxiaosi/commitlint-config/0.0.14_czg@1.4.1+husky@8.0.2: resolution: { - integrity: sha512-4G0b1EajW72/DEpy5tl4QM1LE+NwHByG9fJv2ewP19mNbeiLyieR0uPHDY1dX71qfUutw8AqMetfHKBxhfRoUA==, + integrity: sha512-bEdlb9T8QjzkyXZWs+oBAnXsolL6lIpby/QGNx6KITCZooYdKH3tV/41Sv9CLDH6xuP7Hi/2uGPDuoRBQ07uxw==, } peerDependencies: czg: '>=1.3.11' @@ -2655,10 +2657,10 @@ packages: - '@swc/wasm' dev: true - /@jsxiaosi/eslint-config-base/0.0.13_tqyj5ytb5g6r5ett7xxedhk6eq: + /@jsxiaosi/eslint-config-base/0.0.14_tqyj5ytb5g6r5ett7xxedhk6eq: resolution: { - integrity: sha512-Eqc4xxURP7xO23fduTtuDcbLZN+6uEruk3QuLUGMoPDias7X9nU7xsMhrqzfM8uAoRp3McMUv0vXBsJ1bS3Sdg==, + integrity: sha512-1MG2ajhvMaf7FaY1YMnrbmcdQVzTlqwiBR+egOcrsWXem+ji66Jh/4XdzyL49XTccjTsrm8Fq9jeDVtHG0iF3w==, } peerDependencies: eslint: '>=7.4.0' @@ -2676,10 +2678,10 @@ packages: - supports-color dev: true - /@jsxiaosi/eslint-config-prettier/0.0.13_l5rdqc4k22455lce6ocqroldia: + /@jsxiaosi/eslint-config-prettier/0.0.14_l5rdqc4k22455lce6ocqroldia: resolution: { - integrity: sha512-lkydZd3lmcacS0n7ytCzx2vVmZdPJMpUMfpbVOJ3Q26WIwuNkzEH9JmOFqzKzwqL1mxNQlBfuFy1+6fg/Z4L1Q==, + integrity: sha512-ydLhNTHiM4N/7R97AkJhuVl9b7HZwkaJxqchyBc6l+S9t/AOiD2Egx932rOmhI9DeolHjhTZBfoXcR2Mboma9g==, } peerDependencies: eslint: '>=7.4.0' @@ -2691,16 +2693,16 @@ packages: prettier: 2.8.1 dev: true - /@jsxiaosi/eslint-config-ts/0.0.13_lzzuuodtsqwxnvqeq4g4likcqa: + /@jsxiaosi/eslint-config-ts/0.0.14_lzzuuodtsqwxnvqeq4g4likcqa: resolution: { - integrity: sha512-qcq3KBqTUAqWZodkQRes5yfFMd8ZGICzTm1Z86zT07O13VEJqxSg3iyrDvLhf1sxMYp4kTl/ypKDPR68YO8UaQ==, + integrity: sha512-9nD10CDcMFxDNt1WGr1MxSg7xEzUzZWR3cCrlnDI7vk9ZG+3FFDbaMEJZwidG7hd9HfsHWpnniyBzVyBYa25yA==, } peerDependencies: eslint: '>=7.4.0' typescript: '>=3.9' dependencies: - '@jsxiaosi/eslint-config-base': 0.0.13_tqyj5ytb5g6r5ett7xxedhk6eq + '@jsxiaosi/eslint-config-base': 0.0.14_tqyj5ytb5g6r5ett7xxedhk6eq '@typescript-eslint/eslint-plugin': 5.47.0_ncmi6noazr3nzas7jxykisekym '@typescript-eslint/parser': 5.47.0_lzzuuodtsqwxnvqeq4g4likcqa eslint: 8.30.0 @@ -2711,15 +2713,15 @@ packages: - supports-color dev: true - /@jsxiaosi/eslint-config-vue/0.0.13_lzzuuodtsqwxnvqeq4g4likcqa: + /@jsxiaosi/eslint-config-vue/0.0.14_lzzuuodtsqwxnvqeq4g4likcqa: resolution: { - integrity: sha512-TG9OPb54jbNjaHQ350UeAErCmLiwdH9oxOPssqaXv3xcqePbHXYfPTrG9CJCtUNEuBO+S1Vk1e9WPD+yzzQEgw==, + integrity: sha512-x9ORrP6KqaIA1C9S7+nj6jMLMFM5V8kbgRTPx+JI2o9ygeDS//tSEIC7gt5pn2Po98g7IoPMoaN7fAeIrCt4UQ==, } peerDependencies: eslint: '>=7.4.0' dependencies: - '@jsxiaosi/eslint-config-ts': 0.0.13_lzzuuodtsqwxnvqeq4g4likcqa + '@jsxiaosi/eslint-config-ts': 0.0.14_lzzuuodtsqwxnvqeq4g4likcqa eslint: 8.30.0 eslint-plugin-vue: 9.8.0_eslint@8.30.0 transitivePeerDependencies: diff --git a/tests/HelloWorld.spec.ts b/tests/HelloWorld.spec.ts index 92a2b995..cd24f611 100644 --- a/tests/HelloWorld.spec.ts +++ b/tests/HelloWorld.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from 'vitest'; -import HelloWorld from '../src/components/HelloWorld.vue'; import { mount } from '@vue/test-utils'; +import HelloWorld from '../src/components/HelloWorld.vue'; test('HelloWorld', () => { console.log(HelloWorld); diff --git a/tests/TsxComponents.spec.ts b/tests/TsxComponents.spec.ts index 98cc4fa5..50df43d0 100644 --- a/tests/TsxComponents.spec.ts +++ b/tests/TsxComponents.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from 'vitest'; -import TsxComponents from '../src/components/TsxComponents'; import { mount } from '@vue/test-utils'; +import TsxComponents from '../src/components/TsxComponents'; test('HelloWorld', () => { const wrapper = mount(TsxComponents); diff --git a/tsconfig.json b/tsconfig.json index 9cd05c74..9df5de5c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,9 @@ { // https://www.tslang.cn/docs/handbook/compiler-options.html "compilerOptions": { - "target": "esnext", - "module": "esnext", - "moduleResolution": "node", + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Node", "noLib": false, "strict": true, "skipLibCheck": true, @@ -26,23 +26,17 @@ "isolatedModules": true, "types": ["vite/client", "element-plus/global", "unplugin-vue-macros/macros-global"], "typeRoots": ["./node_modules", "./types"], - "lib": ["esnext", "dom"], + "lib": ["DOM", "DOM.Iterable", "ESNext"], "paths": { "@/*": ["src/*"], "#/*": ["types/*"] } }, - "include": [ - "src/**/*.ts", - "src/**/*.d.ts", - "src/**/*.tsx", - "src/**/*.vue", - "types/*.d.ts", - "types/*.ts", - "tests/*.ts", - "mock/**/*.ts", - "build/**/*.ts", - "vite.config.ts" - ], - "exclude": ["node_modules", "dist", "**/*.js", "discard/"] + "include": ["src", "types", "tests"], + "exclude": ["node_modules", "dist", "**/*.js", "discard/"], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] } diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 00000000..dfc40e98 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true, + "types": ["vite/client"] + }, + "include": ["vite.config.ts", "build", "types", "mock"] +}