ci: add lint-staged check

This commit is contained in:
YunYouJun
2024-09-15 18:14:52 +08:00
parent 41bdc3346f
commit 86b565dfa9
15 changed files with 923 additions and 331 deletions

View File

@@ -1,4 +1,3 @@
name: Production Tag Deployment
env:

1
.npmrc
View File

@@ -1,3 +1,4 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
ignore-workspace-root-check=true

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { installPrompt } from './utils/pwa'
import { appName } from '~/constants'
import { useIndexedDB } from '~/composables/db'
import { appName } from '~/constants'
import { installPrompt } from './utils/pwa'
// https://nuxt.com/docs/api/composables/use-head
useHead({

View File

@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { storeToRefs } from 'pinia'
import type { StuffItem } from '~/types'
import { useEmojiAnimation } from '~/composables/animation'
import { meat, staple, tools, vegetable } from '~/data/food'
import { useEmojiAnimation } from '~/composables/animation'
import type { StuffItem } from '~/types'
const rStore = useRecipeStore()
const { curTool } = storeToRefs(rStore)

View File

@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { DbRecipeItem } from '~/utils/db'
import { recipeHistories } from '~/composables/store/history'
import { tools } from '~/data/food'
import type { RecipeItem } from '~/types'
import { getEmojisFromStuff } from '~/utils'
import { recipeHistories } from '~/composables/store/history'
import type { DbRecipeItem } from '~/utils/db'
const props = defineProps<{
dish: RecipeItem | DbRecipeItem

View File

@@ -1,5 +1,5 @@
import { isClient } from '@vueuse/core'
import type { Ref } from 'vue'
import { isClient } from '@vueuse/core'
export function useEmojiAnimation(recipeBtn: Ref<HTMLButtonElement | undefined>) {
const { x, y } = usePointer()

View File

@@ -1,8 +1,8 @@
import { acceptHMRUpdate, defineStore } from 'pinia'
import { useStorage } from '@vueuse/core'
import { acceptHMRUpdate, defineStore } from 'pinia'
import { ref } from 'vue'
import { defaultSettings } from '../../utils/settings'
import { namespace } from '../../constants'
import { defaultSettings } from '../../utils/settings'
export const useAppStore = defineStore('app', () => {
const deferredPrompt = ref<Event | any>()

View File

@@ -1,10 +1,10 @@
import { acceptHMRUpdate, defineStore } from 'pinia'
import { useStorage } from '@vueuse/core'
import { computed, onMounted, ref, watch } from 'vue'
import { useGtm } from '@gtm-support/vue-gtm'
import { useStorage } from '@vueuse/core'
import { acceptHMRUpdate, defineStore } from 'pinia'
import { computed, onMounted, ref, watch } from 'vue'
import type { RecipeItem, StuffItem } from '~/types'
import { db } from '../../utils/db'
import { useAppStore } from './app'
import type { RecipeItem, StuffItem } from '~/types'
const namespace = 'cook'

View File

@@ -1,5 +1,5 @@
import process from 'node:process'
import type { ModuleOptions } from '@vite-pwa/nuxt'
import process from 'node:process'
import { appDescription, appName } from '../constants/index'
const scope = '/'

View File

@@ -26,7 +26,5 @@
// cook custom
:root {
--cook-bottom-menu-padding-bottom: 20px;
--cook-bottom-menu-height: calc(
64px + var(--cook-bottom-menu-padding-bottom)
);
--cook-bottom-menu-height: calc(64px + var(--cook-bottom-menu-padding-bottom));
}

View File

@@ -28,7 +28,7 @@
"vue-about-me": "^1.2.7"
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.3",
"@antfu/eslint-config": "^3.6.0",
"@headlessui/vue": "^1.7.23",
"@iconify-json/carbon": "^1.2.1",
"@iconify-json/fe": "^1.2.0",
@@ -55,19 +55,29 @@
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"fake-indexeddb": "^6.0.0",
"happy-dom": "^14.12.3",
"jsdom": "^24.1.3",
"jsdom": "^25.0.0",
"lint-staged": "^15.2.10",
"nuxt": "3.13.1",
"nuxt-fix-ofetch": "^0.0.14",
"nuxt-fix-ofetch": "^0.0.15",
"nuxt-vitest": "^0.11.5",
"pinia": "^2.2.2",
"sass": "^1.78.0",
"serve": "^14.2.3",
"simple-git-hooks": "^2.11.1",
"star-markdown-css": "^0.5.1",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"typescript": "^5.5.4",
"unocss": "^0.62.3",
"vitest": "^2.1.1",
"vue-tsc": "^2.1.6"
},
"resolutions": {
"@typescript-eslint/utils": "^8.2.0"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}

1192
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
import type { RecipeItem, Recipes } from '../app/types'
// convert csv to json
import fs from 'node:fs'
import consola from 'consola'
import type { RecipeItem, Recipes } from '../app/types'
import { config } from './config'

View File

@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it } from 'vitest'
import { useRecipeStore } from '../composables/store'
describe('recipe interaction', () => {