mirror your GitHub repos to tangled.org automatically
1import { defineConfig } from 'vite-plus'
2import { defineVitestProject } from '@nuxt/test-utils/config'
3import { playwright } from 'vite-plus/test/browser-playwright'
4
5const rootDir = import.meta.dirname
6
7export default defineConfig({
8 lint: {
9 plugins: ['typescript', 'vue', 'oxc', 'unicorn', 'vitest'],
10 jsPlugins: ['@stylistic/eslint-plugin'],
11 categories: {
12 correctness: 'error',
13 suspicious: 'warn',
14 perf: 'warn',
15 },
16 options: {
17 typeAware: true,
18 typeCheck: true,
19 },
20 rules: {
21 '@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: 'always' }],
22 '@stylistic/semi': ['error', 'never'],
23 '@stylistic/comma-dangle': ['error', 'always-multiline'],
24 '@stylistic/indent': ['error', 2],
25 '@stylistic/no-trailing-spaces': 'error',
26 '@stylistic/eol-last': ['error', 'always'],
27 '@stylistic/object-curly-spacing': ['error', 'always'],
28 '@stylistic/arrow-parens': ['error', 'as-needed'],
29 },
30 ignorePatterns: [
31 '.output/**',
32 '.data/**',
33 '.nuxt/**',
34 '.nitro/**',
35 '.cache/**',
36 'dist/**',
37 'node_modules/**',
38 'coverage/**',
39 'playwright-report/**',
40 'test-results/**',
41 ],
42 },
43 test: {
44 projects: [
45 {
46 test: {
47 name: 'unit',
48 include: ['test/unit/*.{test,spec}.ts'],
49 environment: 'node',
50 },
51 },
52 () =>
53 defineVitestProject({
54 test: {
55 name: 'nuxt',
56 include: ['test/nuxt/*.{test,spec}.ts'],
57 environment: 'nuxt',
58 environmentOptions: {
59 nuxt: {
60 rootDir,
61 overrides: {
62 ogImage: { enabled: false },
63 },
64 },
65 },
66 browser: {
67 enabled: true,
68 provider: playwright(),
69 instances: [
70 { browser: 'chromium' },
71 ],
72 },
73 },
74 }),
75 ],
76 coverage: {
77 enabled: true,
78 provider: 'v8',
79 },
80 },
81})