diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml new file mode 100644 index 00000000..16f0b7a4 --- /dev/null +++ b/.github/workflows/ci-lint.yml @@ -0,0 +1,40 @@ +name: ci-lint + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +permissions: + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: 'pnpm' + + - name: Install dependencies + shell: bash + run: pnpm install --frozen-lockfile --strict-peer-dependencies + + - name: Run Linting and Formatting Check + run: pnpm run lint diff --git a/eslint.config.js b/eslint.config.js index 049f4769..7628d555 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,6 +27,9 @@ export default ts.config( // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors 'no-undef': 'off', + 'no-useless-assignment': 'warn', + 'svelte/no-unused-svelte-ignore': 'off', + '@typescript-eslint/no-unused-vars': 'warn', }, }, { @@ -53,6 +56,8 @@ export default ts.config( 'pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', + 'src/lib/api/internal', + 'src/lib/components/ui', ], } ); diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 3f2cab25..f5d48c4b 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -38,7 +38,7 @@ function GetBasePath(): string { } // Normalize pathname - let pathname = url.pathname === '/' ? '' : url.pathname.replace(/\/+$/, ''); + const pathname = url.pathname === '/' ? '' : url.pathname.replace(/\/+$/, ''); return `${url.origin}${pathname}`; } catch (error) { diff --git a/src/lib/components/Code.svelte b/src/lib/components/Code.svelte index fc93aa64..c882be5e 100644 --- a/src/lib/components/Code.svelte +++ b/src/lib/components/Code.svelte @@ -1,6 +1,8 @@