style: fix linting issues met lint-action

This commit is contained in:
Lint Action 2025-02-28 20:11:48 +00:00
parent 9f88737c48
commit aeab6aee61
14 changed files with 102 additions and 103 deletions

View file

@ -1,10 +1,10 @@
{ {
"recommendations": [ "recommendations": [
"Vue.volar", "Vue.volar",
"vitest.explorer", "vitest.explorer",
"ms-playwright.playwright", "ms-playwright.playwright",
"dbaeumer.vscode-eslint", "dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig", "EditorConfig.EditorConfig",
"esbenp.prettier-vscode" "esbenp.prettier-vscode"
] ]
} }

22
.vscode/settings.json vendored
View file

@ -1,13 +1,13 @@
{ {
"explorer.fileNesting.enabled": true, "explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": { "explorer.fileNesting.patterns": {
"tsconfig.json": "tsconfig.*.json, env.d.ts", "tsconfig.json": "tsconfig.*.json, env.d.ts",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*", "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig" "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
}, },
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit"
}, },
"editor.formatOnSave": false, "editor.formatOnSave": false,
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
} }

View file

@ -1,9 +1,9 @@
import { describe, it, expect } from "vitest"; import { describe, it, expect } from 'vitest';
describe("Sample test", () => { describe('Sample test', () => {
it("should sum to 2", () => { it('should sum to 2', () => {
const expected = 2; const expected = 2;
const result = 1 + 1; const result = 1 + 1;
expect(result).toBe(expected); expect(result).toBe(expected);
}); });
}) });

View file

@ -1,8 +1,6 @@
{ {
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"include": [ "include": ["src/**/*.ts"],
"src/**/*.ts"
],
"compilerOptions": { "compilerOptions": {
"rootDir": "./src", "rootDir": "./src",
"outDir": "./dist" "outDir": "./dist"

View file

@ -1,16 +1,16 @@
services: services:
db: db:
image: postgres:latest image: postgres:latest
environment: environment:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres POSTGRES_DB: postgres
ports: ports:
- "5432:5432" - '5432:5432'
network_mode: "host" network_mode: 'host'
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
- ./backend/config/db/init.sql:/docker-entrypoint-initdb.d/init.sql - ./backend/config/db/init.sql:/docker-entrypoint-initdb.d/init.sql
volumes: volumes:
postgres_data: postgres_data:

View file

@ -16,13 +16,13 @@ export default [
prettierConfig, prettierConfig,
includeIgnoreFile(gitignorePath), includeIgnoreFile(gitignorePath),
{ {
ignores: ['**/dist/**', '**/.node_modules/**', '**/coverage/**', '**/.github/**'], ignores: [
files: [ '**/dist/**',
"**/*.ts", '**/.node_modules/**',
"**/*.cts", '**/coverage/**',
"**.*.mts", '**/.github/**',
"**/*.ts" ],
] files: ['**/*.ts', '**/*.cts', '**.*.mts', '**/*.ts'],
}, },
{ {
languageOptions: { languageOptions: {

View file

@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test'; import { test, expect } from "@playwright/test";
// See here how to get started: // See here how to get started:
// https://playwright.dev/docs/intro // https://playwright.dev/docs/intro
test('visits the app root url', async ({ page }) => { test("visits the app root url", async ({ page }) => {
await page.goto('/'); await page.goto("/");
await expect(page.locator('h1')).toHaveText('You did it!'); await expect(page.locator("h1")).toHaveText("You did it!");
}); });

View file

@ -1,12 +1,9 @@
import pluginVue from 'eslint-plugin-vue'; import pluginVue from "eslint-plugin-vue";
import { import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript";
defineConfigWithVueTs, import pluginVitest from "@vitest/eslint-plugin";
vueTsConfigs, import pluginPlaywright from "eslint-plugin-playwright";
} from '@vue/eslint-config-typescript'; import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
import pluginVitest from '@vitest/eslint-plugin'; import rootConfig from "../eslint.config";
import pluginPlaywright from 'eslint-plugin-playwright';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
import rootConfig from '../eslint.config';
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines: // To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// Import { configureVueProject } from '@vue/eslint-config-typescript' // Import { configureVueProject } from '@vue/eslint-config-typescript'
@ -15,31 +12,28 @@ import rootConfig from '../eslint.config';
const vueConfig = defineConfigWithVueTs( const vueConfig = defineConfigWithVueTs(
{ {
name: 'app/files-to-lint', name: "app/files-to-lint",
files: ['**/*.{ts,mts,tsx,vue}'], files: ["**/*.{ts,mts,tsx,vue}"],
}, },
{ {
name: 'app/files-to-ignore', name: "app/files-to-ignore",
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"],
}, },
pluginVue.configs['flat/essential'], pluginVue.configs["flat/essential"],
vueTsConfigs.recommended, vueTsConfigs.recommended,
{ {
...pluginVitest.configs.recommended, ...pluginVitest.configs.recommended,
files: ['src/**/__tests__/*'], files: ["src/**/__tests__/*"],
}, },
{ {
...pluginPlaywright.configs['flat/recommended'], ...pluginPlaywright.configs["flat/recommended"],
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'], files: ["e2e/**/*.{test,spec}.{js,ts,jsx,tsx}"],
}, },
skipFormatting skipFormatting,
); );
export default [ export default [...rootConfig, ...vueConfig];
...rootConfig,
...vueConfig
]

View file

@ -2,12 +2,21 @@
<html lang=""> <html lang="">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" /> <link
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> rel="icon"
href="/favicon.ico"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Vite App</title> <title>Vite App</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script
type="module"
src="/src/main.ts"
></script>
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
import process from 'node:process'; import process from "node:process";
import { defineConfig, devices } from '@playwright/test'; import { defineConfig, devices } from "@playwright/test";
/** /**
* Read environment variables from file. * Read environment variables from file.
@ -11,7 +11,7 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
export default defineConfig({ export default defineConfig({
testDir: './e2e', testDir: "./e2e",
/* Maximum time one test can run for. */ /* Maximum time one test can run for. */
timeout: 30 * 1000, timeout: 30 * 1000,
expect: { expect: {
@ -28,18 +28,16 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined, workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: { use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0, actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.CI baseURL: process.env.CI ? "http://localhost:4173" : "http://localhost:5173",
? 'http://localhost:4173'
: 'http://localhost:5173',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry', trace: "on-first-retry",
/* Only on CI systems run the tests headless */ /* Only on CI systems run the tests headless */
headless: Boolean(process.env.CI), headless: Boolean(process.env.CI),
@ -48,21 +46,21 @@ export default defineConfig({
/* Configure projects for major browsers */ /* Configure projects for major browsers */
projects: [ projects: [
{ {
name: 'chromium', name: "chromium",
use: { use: {
...devices['Desktop Chrome'], ...devices["Desktop Chrome"],
}, },
}, },
{ {
name: 'firefox', name: "firefox",
use: { use: {
...devices['Desktop Firefox'], ...devices["Desktop Firefox"],
}, },
}, },
{ {
name: 'webkit', name: "webkit",
use: { use: {
...devices['Desktop Safari'], ...devices["Desktop Safari"],
}, },
}, },
@ -105,7 +103,7 @@ export default defineConfig({
* Use the preview server on CI for more realistic testing. * Use the preview server on CI for more realistic testing.
* Playwright will re-use the local server if there is already a dev-server running. * Playwright will re-use the local server if there is already a dev-server running.
*/ */
command: process.env.CI ? 'npm run preview' : 'npm run dev', command: process.env.CI ? "npm run preview" : "npm run dev",
port: process.env.CI ? 4173 : 5173, port: process.env.CI ? 4173 : 5173,
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,
}, },

View file

@ -2,10 +2,10 @@
* @type {import("prettier").Options} * @type {import("prettier").Options}
*/ */
const rootConfig = import ('../prettier.config.js'); const rootConfig = import("../prettier.config.js");
export default { export default {
...rootConfig, ...rootConfig,
vueIndentScriptAndStyle: true, vueIndentScriptAndStyle: true,
singleAttributePerLine: true singleAttributePerLine: true,
}; };

View file

@ -1,15 +1,15 @@
import { fileURLToPath, URL } from 'node:url'; import { fileURLToPath, URL } from "node:url";
import { defineConfig } from 'vite'; import { defineConfig } from "vite";
import vue from '@vitejs/plugin-vue'; import vue from "@vitejs/plugin-vue";
import vueDevTools from 'vite-plugin-vue-devtools'; import vueDevTools from "vite-plugin-vue-devtools";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue(), vueDevTools()], plugins: [vue(), vueDevTools()],
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)), "@": fileURLToPath(new URL("./src", import.meta.url)),
}, },
}, },
}); });

View file

@ -1,14 +1,14 @@
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from "node:url";
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'; import { mergeConfig, defineConfig, configDefaults } from "vitest/config";
import viteConfig from './vite.config'; import viteConfig from "./vite.config";
export default mergeConfig( export default mergeConfig(
viteConfig, viteConfig,
defineConfig({ defineConfig({
test: { test: {
environment: 'jsdom', environment: "jsdom",
exclude: [...configDefaults.exclude, 'e2e/**'], exclude: [...configDefaults.exclude, "e2e/**"],
root: fileURLToPath(new URL('./', import.meta.url)), root: fileURLToPath(new URL("./", import.meta.url)),
}, },
}), }),
); );

View file

@ -10,4 +10,4 @@ export default {
objectWrap: 'preserve', objectWrap: 'preserve',
bracketSameLine: false, bracketSameLine: false,
arrowParens: 'always', arrowParens: 'always',
} };