aboutsummaryrefslogtreecommitdiffstats
path: root/vitest.config.ts
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-06-28 18:15:51 +0200
committerGitHub <noreply@github.com>2024-06-28 16:15:51 +0000
commit08579d6cbb65399dec408f3b90bc9a9e285e6206 (patch)
treeb7ac4e42f33d59ae4f7b6a33ae5c15c2b8d00e7f /vitest.config.ts
parentdf805d6ed0458dbec258d115238fde794ed4d0ce (diff)
downloadgitea-08579d6cbb65399dec408f3b90bc9a9e285e6206.tar.gz
gitea-08579d6cbb65399dec408f3b90bc9a9e285e6206.zip
Add initial typescript config and use it for eslint,vitest,playwright (#31186)
This enables eslint to use the typescript parser and resolver which brings some benefits that eslint rules now have type information available and a tsconfig.json is required for the upcoming typescript migration as well. Notable changes done: - Add typescript parser and resolver - Move the vue-specific config into the root file - Enable `vue-scoped-css/enforce-style-type` rule, there was only one violation and I added a inline disable there. - Fix new lint errors that were detected because of the parser change - Update `i/no-unresolved` to remove now-unnecessary workaround for the resolver - Disable `i/no-named-as-default` as it seems to raise bogus issues in the webpack config - Change vitest config to typescript - Change playwright config to typescript - Add `eslint-plugin-playwright` and fix issues - Add `tsc` linting to `make lint-js`
Diffstat (limited to 'vitest.config.ts')
-rw-r--r--vitest.config.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/vitest.config.ts b/vitest.config.ts
new file mode 100644
index 0000000000..ea0fafeee8
--- /dev/null
+++ b/vitest.config.ts
@@ -0,0 +1,21 @@
+import {defineConfig} from 'vitest/config';
+import vuePlugin from '@vitejs/plugin-vue';
+import {stringPlugin} from 'vite-string-plugin';
+
+export default defineConfig({
+ test: {
+ include: ['web_src/**/*.test.js'],
+ setupFiles: ['web_src/js/vitest.setup.js'],
+ environment: 'happy-dom',
+ testTimeout: 20000,
+ open: false,
+ allowOnly: true,
+ passWithNoTests: true,
+ globals: true,
+ watch: false,
+ },
+ plugins: [
+ stringPlugin(),
+ vuePlugin(),
+ ],
+});