Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

# Lint, typecheck, and test are not included yet: they currently fail in packages/tab-id-hook
# (no ESLint config or tsconfig). Add them once fixed.
- name: Check formatting
run: pnpm --recursive --if-present run format:check

- name: Lint
run: pnpm --recursive --if-present run lint:check

- name: Typecheck
run: pnpm --recursive --if-present run typecheck

- name: Test
run: pnpm --recursive --if-present run test:coverage

- name: Build
run: pnpm --recursive --if-present run build

Expand Down
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig([
{
ignores: ["**/build/**", "**/dist/**", "**/.react-router/**", "**/coverage/**"],
},
{
files: ["**/*.{ts,tsx}"],
extends: [js.configs.recommended, tseslint.configs.recommended],
},
]);
3 changes: 1 addition & 2 deletions examples/tab-id-hook/app/routes/home.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Link } from "react-router";
import { Welcome } from "../welcome/welcome";
import type { Route } from "./+types/home";

export function meta({}: Route.MetaArgs) {
export function meta() {
return [
{ title: "New React Router App" },
{ name: "description", content: "Welcome to React Router!" },
Expand Down
1 change: 1 addition & 0 deletions examples/tab-id-hook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build": "react-router build",
"dev": "react-router dev",
"start": "react-router-serve ./build/server/index.js",
"lint:check": "eslint --cache --cache-location ./node_modules/.cache/eslint/ --ext .ts,.tsx ./",
"typecheck": "react-router typegen && tsc"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/tab-id-hook/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Release Please owns the generated changelog format.
CHANGELOG.md
dist/
coverage/
6 changes: 3 additions & 3 deletions packages/tab-id-hook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"exports:check": "attw --pack ./",
"format:check": "prettier --cache --cache-location ./node_modules/.cache/prettier/ --check ./",
"format:fix": "prettier --cache --cache-location ./node_modules/.cache/prettier/ --write ./",
"lint:check": "eslint --cache --cache-location: ./node_modules/.cache/eslint/ ./",
"lint:fix": "eslint --cache --cache-location: ./node_modules/.cache/eslint/ --fix ./",
"lint:check": "eslint --cache --cache-location ./node_modules/.cache/eslint/ --ext .ts,.tsx ./",
"lint:fix": "eslint --cache --cache-location ./node_modules/.cache/eslint/ --ext .ts,.tsx --fix ./",
"test": "vitest",
"test:coverage": "vitest --coverage",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/tab-id-hook/src/client/use-tab-id.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ describe("use-tab-id()", () => {

act(() => {
window.dispatchEvent(
new StorageEvent("storage", {
new window.StorageEvent("storage", {
key: "tab-id",
newValue: "xx-9999",
storageArea: window.sessionStorage,
}),
);
});
Expand Down
16 changes: 16 additions & 0 deletions packages/tab-id-hook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts"]
}
Loading