From b51c545efd7ecc4760ddf81785e69d9749adc8f8 Mon Sep 17 00:00:00 2001 From: wenqing Date: Mon, 30 Dec 2024 11:09:45 +0800 Subject: [PATCH] chore(example): update example build --- .github/workflows/deploy.yml | 2 +- example/.editorconfig | 6 +++++ example/.eslintrc.cjs | 15 ----------- example/.prettierrc.json | 4 ++- example/eslint.config.js | 25 ++++++++++++++++++ example/package.json | 26 +++++++++---------- .../components/ComponentQueryString/index.vue | 3 +-- example/tsconfig.node.json | 2 +- 8 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 example/.editorconfig delete mode 100644 example/.eslintrc.cjs create mode 100644 example/eslint.config.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 80fb00b..c156641 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 22 # pull code - name: Checkout code diff --git a/example/.editorconfig b/example/.editorconfig new file mode 100644 index 0000000..99e1f44 --- /dev/null +++ b/example/.editorconfig @@ -0,0 +1,6 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/example/.eslintrc.cjs b/example/.eslintrc.cjs deleted file mode 100644 index 83b36d4..0000000 --- a/example/.eslintrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') - -module.exports = { - root: true, - extends: [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-typescript', - '@vue/eslint-config-prettier', - ], - parserOptions: { - ecmaVersion: 'latest', - }, -} diff --git a/example/.prettierrc.json b/example/.prettierrc.json index ceaedc0..8d8c39f 100644 --- a/example/.prettierrc.json +++ b/example/.prettierrc.json @@ -1,5 +1,7 @@ + { + "$schema": "https://json.schemastore.org/prettierrc", "semi": false, "singleQuote": true, - "endOfLine": "auto" + "printWidth": 100 } \ No newline at end of file diff --git a/example/eslint.config.js b/example/eslint.config.js new file mode 100644 index 0000000..9153fba --- /dev/null +++ b/example/eslint.config.js @@ -0,0 +1,25 @@ +import pluginVue from 'eslint-plugin-vue' +import vueTsEslintConfig from '@vue/eslint-config-typescript' +import pluginVitest from '@vitest/eslint-plugin' +import skipFormatting from '@vue/eslint-config-prettier' + +export default [ + { + name: 'app/files-to-lint', + files: ['**/*.{ts,mts,tsx,vue}'], + }, + + { + name: 'app/files-to-ignore', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, + + ...pluginVue.configs['flat/essential'], + ...vueTsEslintConfig(), + + { + ...pluginVitest.configs.recommended, + files: ['src/**/__tests__/*'], + }, + skipFormatting, +] diff --git a/example/package.json b/example/package.json index 26931dc..ed40f86 100644 --- a/example/package.json +++ b/example/package.json @@ -21,30 +21,30 @@ "vue-router": "^4.5.0" }, "devDependencies": { - "@rushstack/eslint-patch": "^1.10.4", - "@tsconfig/node18": "^18.2.4", + "@tsconfig/node22": "^22.0.0", "@types/jsdom": "^20.0.1", "@types/node": "^18.19.67", "@types/prismjs": "^1.26.5", - "@vitejs/plugin-vue": "^4.6.2", - "@vitejs/plugin-vue-jsx": "^3.1.0", - "@vue/eslint-config-prettier": "^7.1.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^4.1.1", + "@vitest/eslint-plugin": "^1.1.21", + "@vue/eslint-config-prettier": "^10.1.0", + "@vue/eslint-config-typescript": "^14.2.0", "@vue/test-utils": "^2.4.6", - "@vue/tsconfig": "^0.4.0", + "@vue/tsconfig": "^0.7.0", "eslint": "^9.15.0", "eslint-plugin-vue": "^9.31.0", - "jsdom": "^20.0.3", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.8", + "jsdom": "^25.0.1", + "npm-run-all2": "^7.0.2", + "prettier": "^3.4.2", "prismjs": "^1.29.0", "sass": "^1.81.0", "typescript": "^5.7.2", "vite": "^6.0.1", - "vitest": "^0.34.6", - "vue-tsc": "^1.8.27" + "vitest": "^2.1.8", + "vue-tsc": "^2.2.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } } diff --git a/example/src/components/ComponentQueryString/index.vue b/example/src/components/ComponentQueryString/index.vue index 2c71864..2328eb8 100644 --- a/example/src/components/ComponentQueryString/index.vue +++ b/example/src/components/ComponentQueryString/index.vue @@ -4,8 +4,7 @@