diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml new file mode 100644 index 0000000000..75d1b2ec99 --- /dev/null +++ b/.github/workflows/fmt-check.yml @@ -0,0 +1,54 @@ +# This is a basic workflow to help you get started with Actions + +name: fmt-check + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches-ignore: + - 'develop' + - 'develop*' + - 'archive/**' + - 'deploy/**' + paths-ignore: + - '.gitignore' + - '**.png' + - '**.jpg' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + fmt-check: + # The type of runner that the job will run on + runs-on: ubuntu-latest + timeout-minutes: 15 + + strategy: + fail-fast: true + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Set up Node.js 20.x + uses: actions/setup-node@v4.2.0 + id: setup_node_id + with: + node-version: 20 + cache: 'yarn' + cache-dependency-path: yarn.lock + + # - run: echo '${{ toJSON(steps.setup_node_id.outputs) }}' + # - if: ${{ steps.setup_node_id.outputs.cache-hit != 'true' }} + - name: Install dependencies + run: yarn + + - name: Setup + run: yarn fmt + + - name: Check if there is no file diff + run: yarn zz:check:no-diff diff --git a/.github/workflows/lint-test-type-check.yml b/.github/workflows/lint-test-type-check.yml index a9f0a7ca2e..c72e5ae3c7 100644 --- a/.github/workflows/lint-test-type-check.yml +++ b/.github/workflows/lint-test-type-check.yml @@ -37,7 +37,7 @@ jobs: fail-fast: true matrix: command: - - fmt:all + - fmt - ws:gi - type-check-eslint-configs - ws:type-check diff --git a/experimental/my-svelte-app/eslint.config.js b/experimental/my-svelte-app/eslint.config.js index e18311fa76..97e7731884 100644 --- a/experimental/my-svelte-app/eslint.config.js +++ b/experimental/my-svelte-app/eslint.config.js @@ -1,34 +1,34 @@ -import prettier from "eslint-config-prettier"; -import js from '@eslint/js'; import { includeIgnoreFile } from '@eslint/compat'; +import js from '@eslint/js'; +import prettier from 'eslint-config-prettier'; import svelte from 'eslint-plugin-svelte'; import globals from 'globals'; import { fileURLToPath } from 'node:url'; import ts from 'typescript-eslint'; -const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url)); +const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); export default ts.config( includeIgnoreFile(gitignorePath), js.configs.recommended, ...ts.configs.recommended, - ...svelte.configs["flat/recommended"], + ...svelte.configs['flat/recommended'], prettier, ...svelte.configs['flat/prettier'], { languageOptions: { - globals: { - ...globals.browser, - ...globals.node - } - } + globals: { + ...globals.browser, + ...globals.node, + }, + }, }, { - files: ["**/*.svelte"], + files: ['**/*.svelte'], languageOptions: { - parserOptions: { - parser: ts.parser - } - } - } + parserOptions: { + parser: ts.parser, + }, + }, + }, ); diff --git a/experimental/my-svelte-app/package.json b/experimental/my-svelte-app/package.json index bfcd98b918..ccae7bfd33 100644 --- a/experimental/my-svelte-app/package.json +++ b/experimental/my-svelte-app/package.json @@ -1,40 +1,40 @@ { - "name": "my-svelte-app", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "prepare": "svelte-kit sync || echo ''", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "format": "prettier --write .", - "lint": "prettier --check . && eslint .", - "test:unit": "vitest", - "test": "npm run test:unit -- --run" - }, - "devDependencies": { - "@eslint/compat": "^1.2.5", - "@eslint/js": "^9.18.0", - "@sveltejs/adapter-auto": "^4.0.0", - "@sveltejs/kit": "^2.16.0", - "@sveltejs/vite-plugin-svelte": "^5.0.0", - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/svelte": "^5.2.4", - "eslint": "^9.18.0", - "eslint-config-prettier": "^10.0.1", - "eslint-plugin-svelte": "^2.46.1", - "globals": "^15.14.0", - "jsdom": "^25.0.1", - "prettier": "^3.4.2", - "prettier-plugin-svelte": "^3.3.3", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "typescript": "^5.0.0", - "typescript-eslint": "^8.20.0", - "vite": "^6.0.0", - "vitest": "^3.0.0" - } + "name": "my-svelte-app", + "version": "0.0.1", + "private": true, + "type": "module", + "scripts": { + "build": "vite build", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "dev": "vite dev", + "format": "prettier --write .", + "lint": "prettier --check . && eslint .", + "prepare": "svelte-kit sync || echo ''", + "preview": "vite preview", + "test": "npm run test:unit -- --run", + "test:unit": "vitest" + }, + "devDependencies": { + "@eslint/compat": "^1.2.5", + "@eslint/js": "^9.18.0", + "@sveltejs/adapter-auto": "^4.0.0", + "@sveltejs/kit": "^2.16.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/svelte": "^5.2.4", + "eslint": "^9.18.0", + "eslint-config-prettier": "^10.0.1", + "eslint-plugin-svelte": "^2.46.1", + "globals": "^15.14.0", + "jsdom": "^25.0.1", + "prettier": "^3.4.2", + "prettier-plugin-svelte": "^3.3.3", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "typescript": "^5.0.0", + "typescript-eslint": "^8.20.0", + "vite": "^6.0.0", + "vitest": "^3.0.0" + } } diff --git a/experimental/my-svelte-app/src/app.d.ts b/experimental/my-svelte-app/src/app.d.ts index da08e6da59..520c4217a1 100644 --- a/experimental/my-svelte-app/src/app.d.ts +++ b/experimental/my-svelte-app/src/app.d.ts @@ -1,13 +1,13 @@ // See https://svelte.dev/docs/kit/types#app.d.ts // for information about these interfaces declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} - // interface Platform {} - } + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } } export {}; diff --git a/experimental/my-svelte-app/src/app.html b/experimental/my-svelte-app/src/app.html index 77a5ff52c9..84ffad1665 100644 --- a/experimental/my-svelte-app/src/app.html +++ b/experimental/my-svelte-app/src/app.html @@ -1,12 +1,12 @@ -
- - - - %sveltekit.head% - - -