chore(client): add lint, format and test tooling
Configure ESLint 10 (flat, Vue + a11y), Prettier, Vitest + @vue/test-utils + jsdom, and add npm scripts for lint/format/test. Document VITE_API_BASE_URL.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# SurrealDB — frontend (Vite)
|
||||
|
||||
# Bazowy adres API backendu (BFF). Pusty = ten sam origin (proxy Vite w dev).
|
||||
VITE_API_BASE_URL=
|
||||
|
||||
# Wspólna przestrzeń nazw / baza
|
||||
VITE_SURREAL_NAMESPACE=hubmi
|
||||
VITE_SURREAL_DATABASE=hubmi
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
dist
|
||||
node_modules
|
||||
coverage
|
||||
package-lock.json
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "all",
|
||||
"arrowParens": "always"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import js from '@eslint/js'
|
||||
import prettier from 'eslint-config-prettier'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import vueA11y from 'eslint-plugin-vuejs-accessibility'
|
||||
import globals from 'globals'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ['dist/**', 'node_modules/**', 'coverage/**'] },
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
...pluginVue.configs['flat/recommended'],
|
||||
...vueA11y.configs['flat/recommended'],
|
||||
{
|
||||
files: ['**/*.{ts,vue}'],
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser },
|
||||
parserOptions: {
|
||||
parser: tseslint.parser,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
},
|
||||
},
|
||||
prettier,
|
||||
)
|
||||
Generated
+2977
-38
File diff suppressed because it is too large
Load Diff
+22
-1
@@ -6,23 +6,44 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"copy": "node ../scripts/copy-client.mjs",
|
||||
"preview": "vite preview"
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:a11y": "vitest run --dir src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "^7.4.47",
|
||||
"@surrealdb/wasm": "^2.6.1",
|
||||
"@vueuse/core": "^15.0.0",
|
||||
"pinia": "^4.0.3",
|
||||
"surrealdb": "^2.0.10",
|
||||
"vue": "^3.5.42",
|
||||
"vue-i18n": "^11.4.13",
|
||||
"vue-router": "^5.3.1",
|
||||
"vuetify": "^4.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/node": "^24.13.3",
|
||||
"@vitejs/plugin-vue": "^6.0.8",
|
||||
"@vue/test-utils": "^2.5.1",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"eslint": "^10.12.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-vue": "^10.11.1",
|
||||
"eslint-plugin-vuejs-accessibility": "^2.6.0",
|
||||
"globals": "^17.13.0",
|
||||
"jsdom": "^29.1.1",
|
||||
"prettier": "^3.9.9",
|
||||
"typescript": "~6.0.2",
|
||||
"typescript-eslint": "^8.71.0",
|
||||
"vite": "^8.3.0",
|
||||
"vitest": "^5.0.3",
|
||||
"vue-tsc": "^3.3.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
include: ['src/**/*.spec.ts'],
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user