diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 6f40582..0000000 --- a/.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/skip-formatting' - ], - parserOptions: { - ecmaVersion: 'latest' - } -} diff --git a/env.d.ts b/env.d.ts index 5c06b76..7f106c6 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,9 +1,6 @@ /// -// https://github.com/intlify/vue-i18n-next/issues/1403 -/// -/// -declare module 'vue-i18n' + interface ImportMetaEnv { readonly SAFETWITCH_BACKEND_DOMAIN: string diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..20475f8 --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,22 @@ +import { globalIgnores } from 'eslint/config' +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' +import pluginVue from 'eslint-plugin-vue' +import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' + +// To allow more languages other than `ts` in `.vue` files, uncomment the following lines: +// import { configureVueProject } from '@vue/eslint-config-typescript' +// configureVueProject({ scriptLangs: ['ts', 'tsx'] }) +// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup + +export default defineConfigWithVueTs( + { + name: 'app/files-to-lint', + files: ['**/*.{ts,mts,tsx,vue}'], + }, + + globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), + + pluginVue.configs['flat/essential'], + vueTsConfigs.recommended, + skipFormatting, +) diff --git a/package-lock.json b/package-lock.json index 7d6f35f..fe3cb29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "eslint": "^9.31.0", "eslint-plugin-vue": "~10.4.0", "git-describe": "^4.1.1", + "jiti": "^2.4.2", "npm-run-all2": "^8.0.4", "prettier": "3.6.2", "tailwindcss": "^3.4.17", @@ -4432,12 +4433,13 @@ } }, "node_modules/jiti": { - "version": "1.21.7", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", - "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "devOptional": true, "license": "MIT", "bin": { - "jiti": "bin/jiti.js" + "jiti": "lib/jiti-cli.mjs" } }, "node_modules/js-tokens": { @@ -6008,6 +6010,15 @@ "tailwindcss": "^3.1.0" } }, + "node_modules/tailwindcss/node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, "node_modules/tailwindcss/node_modules/lilconfig": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", diff --git a/package.json b/package.json index e2b5fc8..11c95a7 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "2.3.1", "private": true, "scripts": { - "build": "run-p type-check \"build-only {@}\" --", - "lint": "eslint . --ext .vue,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", - "build-only": "vite build", "dev": "vite", - "format": "prettier --write src/", + "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", - "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false" + "build-only": "vite build", + "type-check": "vue-tsc --build", + "lint": "eslint . --fix", + "format": "prettier --write src/" }, "dependencies": { "@intlify/unplugin-vue-i18n": "^11.0.0", @@ -42,6 +42,7 @@ "git-describe": "^4.1.1", "npm-run-all2": "^8.0.4", "prettier": "3.6.2", + "jiti": "^2.4.2", "tailwindcss": "^3.4.17", "tailwindcss-themer": "^4.1.1", "typescript": "^5.9.2",