Skip to content

Commit

Permalink
chore: update deps & eslint use @antfu/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
shy1118999 committed Oct 31, 2023
1 parent 65c881f commit c51f613
Show file tree
Hide file tree
Showing 16 changed files with 1,109 additions and 853 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
46 changes: 43 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
{
"files.associations": {
"*.css": "postcss"
},

// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
"editor.formatOnSave": false,
"editor.tabSize": 2

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// The following is optional.
// It's better to put under project setting `.vscode/settings.json`
// to avoid conflicts with working with different eslint configs
// that does not support all formats.
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
8 changes: 7 additions & 1 deletion auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ declare global {
const h: typeof import('vue')['h']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDark: typeof import('./src/composables/dark')['isDark']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
Expand Down Expand Up @@ -67,6 +68,7 @@ declare global {
const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
const reactive: typeof import('vue')['reactive']
Expand Down Expand Up @@ -286,7 +288,7 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
}
// for vue template auto import
import { UnwrapRef } from 'vue'
Expand Down Expand Up @@ -324,6 +326,7 @@ declare module 'vue' {
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDark: UnwrapRef<typeof import('./src/composables/dark')['isDark']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
Expand Down Expand Up @@ -354,6 +357,7 @@ declare module 'vue' {
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
Expand Down Expand Up @@ -605,6 +609,7 @@ declare module '@vue/runtime-core' {
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDark: UnwrapRef<typeof import('./src/composables/dark')['isDark']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
Expand Down Expand Up @@ -635,6 +640,7 @@ declare module '@vue/runtime-core' {
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
Expand Down
7 changes: 7 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import antfu from '@antfu/eslint-config'
import unocss from '@unocss/eslint-plugin'

export default antfu(
{},
unocss.configs.flat,
)
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "shy-vue-template",
"type": "module",
"version": "1.0.0",
"private": true,
"packageManager": "pnpm@7.4.0",
"packageManager": "pnpm@8.8.0",
"description": "Template for vue3",
"author": "shy1118",
"license": "MIT",
Expand All @@ -12,35 +13,42 @@
"preview": "vite preview",
"lint": "eslint .",
"test": "vitest",
"typecheck": "vue-tsc --noEmit"
"typecheck": "vue-tsc --noEmit",
"postinstall": "npx simple-git-hooks"
},
"dependencies": {
"@vueuse/core": "^10.5.0",
"vue": "^3.3.5",
"vue": "^3.3.7",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@antfu/eslint-config": "1.0.0-beta.29",
"@iconify-json/carbon": "^1.1.21",
"@shy1118/eslint-config": "^1.0.5",
"@types/node": "20.2.1",
"@unocss/eslint-plugin": "^0.57.1",
"@unocss/reset": "^0.56.5",
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/runtime-core": "^3.3.5",
"@vue/runtime-core": "^3.3.7",
"@vue/test-utils": "^2.4.1",
"eslint": "^8.51.0",
"eslint": "^8.52.0",
"jsdom": "^22.1.0",
"pnpm": "^8.9.2",
"lint-staged": "^15.0.2",
"pnpm": "^8.10.0",
"simple-git-hooks": "^2.9.0",
"typescript": "^5.2.2",
"unocss": "^0.56.5",
"unplugin-auto-import": "^0.16.6",
"unplugin-auto-import": "^0.16.7",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.5.0",
"vite-plugin-pages": "^0.30.1",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.19"
"vue-tsc": "^1.8.22"
},
"eslintConfig": {
"extends": "@shy1118"
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}

0 comments on commit c51f613

Please sign in to comment.