Skip to content

Commit

Permalink
build: 📦️ update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Dec 24, 2022
1 parent 5716a32 commit 11d2c7c
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 52 deletions.
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"]
}
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "xsadmin",
"version": "1.6.0",
"version": "1.6.1",
"author": {
"name": "小斯斯",
"email": "[email protected]",
"url": "https://github.com/SuperCuteXiaoSi"
},
"license": "MIT",
"engines": {
"node": "14.x || 16.x"
},
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -123,7 +128,6 @@
"vue-tsc": "^1.0.16",
"xlsx": "^0.18.5"
},
"license": "MIT",
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
Expand All @@ -135,11 +139,6 @@
]
}
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
},
"resolutions": {
"bin-wrapper": "npm:bin-wrapper-china"
},
Expand Down Expand Up @@ -167,7 +166,9 @@
"prettier --write"
]
},
"engines": {
"node": "14.x || 16.x"
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}
}
38 changes: 20 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/HelloWorld.spec.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/TsxComponents.spec.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
28 changes: 11 additions & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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"
}
]
}
10 changes: 10 additions & 0 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"types": ["vite/client"]
},
"include": ["vite.config.ts", "build", "types", "mock"]
}

0 comments on commit 11d2c7c

Please sign in to comment.