Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { defineConfig, mergeConfig } from 'vitest/config'
|
||||
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { defineConfig, mergeConfig } from "vitest/config"
|
||||
import { storybookTest } from "@storybook/addon-vitest/vitest-plugin"
|
||||
import { playwright } from "@vitest/browser-playwright"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
const dirname =
|
||||
typeof __dirname !== 'undefined'
|
||||
typeof __dirname !== "undefined"
|
||||
? __dirname
|
||||
: path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
import viteConfig from './vite.config'
|
||||
import viteConfig from "./vite.config"
|
||||
|
||||
const isCI = process.env.CI === 'true'
|
||||
const isCI = process.env.CI === "true"
|
||||
|
||||
const browserInstances = isCI
|
||||
? [{ browser: 'chromium' as const }]
|
||||
? [{ browser: "chromium" as const }]
|
||||
: [
|
||||
{ browser: 'chromium' as const },
|
||||
{ browser: 'firefox' as const },
|
||||
{ browser: 'webkit' as const },
|
||||
{ browser: "chromium" as const },
|
||||
{ browser: "firefox" as const },
|
||||
{ browser: "webkit" as const },
|
||||
]
|
||||
|
||||
export default mergeConfig(
|
||||
@@ -28,22 +28,22 @@ export default mergeConfig(
|
||||
projects: [
|
||||
{
|
||||
test: {
|
||||
name: 'unit',
|
||||
environment: 'jsdom',
|
||||
name: "unit",
|
||||
environment: "jsdom",
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: [
|
||||
storybookTest({
|
||||
// The location of your Storybook config, main.js|ts
|
||||
configDir: path.join(dirname, '.storybook'),
|
||||
configDir: path.join(dirname, ".storybook"),
|
||||
// This should match your package.json script to run Storybook
|
||||
// The --ci flag will skip prompts and not open a browser
|
||||
storybookScript: 'yarn storybook --ci',
|
||||
storybookScript: "yarn storybook --ci",
|
||||
}),
|
||||
],
|
||||
test: {
|
||||
name: 'storybook',
|
||||
name: "storybook",
|
||||
// Enable browser mode
|
||||
browser: {
|
||||
enabled: true,
|
||||
@@ -52,7 +52,7 @@ export default mergeConfig(
|
||||
headless: true,
|
||||
instances: browserInstances,
|
||||
},
|
||||
setupFiles: ['./.storybook/vitest.setup.ts'],
|
||||
setupFiles: ["./.storybook/vitest.setup.ts"],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user