Skip to content

Commit

Permalink
Lint in CI (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasballinger authored Nov 27, 2024
1 parent a4eae7f commit 0e07935
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ module.exports = {
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
],
ignorePatterns: [".eslintrc.cjs", "test", "docs", "dist"],
ignorePatterns: [
".eslintrc.cjs",
"test",
"docs",
"dist",
"test-nextjs/backendHarness.js",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"

- name: Install dependencies
run: |
npm ci
cd test; npm i
cd ../test-nextjs; npm i
cd ../test-router; npm i
- name: Run linting
run: npm run lint
2 changes: 1 addition & 1 deletion test-nextjs/e2e-tests/signin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test("signin fails correctly", async ({ page }) => {
let message = "";
page.on("dialog", (dialog) => {
message = dialog.message();
dialog.accept();
void dialog.accept();
});

await page.getByRole("button").getByText("Sign in with secret").click();
Expand Down
2 changes: 1 addition & 1 deletion test-nextjs/e2e-tests/signout.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
import { test } from "@playwright/test";

test("signout works", async ({ page }) => {
await page.goto("/signin");
Expand Down
2 changes: 1 addition & 1 deletion test-router/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Layout } from "@/Layout";
import { UserMenu } from "@/components/UserMenu";
import { ConvexAuthProvider } from "@convex-dev/auth/react";
import { createRootRoute, Outlet, useRouter } from "@tanstack/react-router";
import { createRootRoute, Outlet } from "@tanstack/react-router";
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
import {
Authenticated,
Expand Down
1 change: 0 additions & 1 deletion test-router/src/routes/loggedin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useAuthActions } from "@convex-dev/auth/react";
import { createFileRoute, useRouter } from "@tanstack/react-router";
import { useEffect } from "react";

export const Route = createFileRoute("/loggedin")({
component: About,
Expand Down
14 changes: 6 additions & 8 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e07935

Please sign in to comment.