Skip to content

Commit d7c3aac

Browse files
committed
Tighten format checks
1 parent 31507e1 commit d7c3aac

7 files changed

Lines changed: 31 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
validate:
18-
name: Lint and build
18+
name: Format, lint, and build
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 10
2121

@@ -32,6 +32,9 @@ jobs:
3232
- name: Install dependencies
3333
run: npm ci
3434

35+
- name: Check formatting
36+
run: npm run format:check
37+
3538
- name: Lint
3639
run: npm run lint
3740

.prettierrc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"singleQuote": true,
3-
"tabWidth": 2,
4-
"plugins": [
5-
"prettier-plugin-tailwindcss"
6-
],
7-
"tailwindStylesheet": "./src/index.css"
8-
}
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"plugins": ["prettier-plugin-tailwindcss"],
5+
"tailwindStylesheet": "./src/index.css"
6+
}

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ The current parser expects a simple two-column numeric CSV:
5454

5555
## Scripts
5656

57-
| Script | Description |
58-
| :---------------- | :--------------------------------------------------------------- |
59-
| `npm run dev` | Starts the Vite development server. |
60-
| `npm run build` | Runs TypeScript build checks and bundles the app for production. |
61-
| `npm run lint` | Runs ESLint. |
62-
| `npm run preview` | Serves the production build locally. |
63-
| `npm run format` | Formats `src/**/*.{ts,tsx}` with Prettier. |
57+
| Script | Description |
58+
| :--------------------- | :--------------------------------------------------------------- |
59+
| `npm run dev` | Starts the Vite development server. |
60+
| `npm run build` | Runs TypeScript build checks and bundles the app for production. |
61+
| `npm run lint` | Runs ESLint. |
62+
| `npm run preview` | Serves the production build locally. |
63+
| `npm run format` | Formats the repository with Prettier. |
64+
| `npm run format:check` | Checks repository formatting without writing changes. |
6465

6566
## Project Structure
6667

components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"hooks": "@/hooks"
1919
},
2020
"iconLibrary": "lucide"
21-
}
21+
}

eslint.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import js from '@eslint/js'
2-
import globals from 'globals'
3-
import reactHooks from 'eslint-plugin-react-hooks'
4-
import reactRefresh from 'eslint-plugin-react-refresh'
5-
import tseslint from 'typescript-eslint'
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
66

77
export default tseslint.config(
88
{ ignores: ['dist'] },
@@ -25,4 +25,4 @@ export default tseslint.config(
2525
],
2626
},
2727
},
28-
)
28+
);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"build": "tsc -b && vite build",
1414
"lint": "eslint .",
1515
"preview": "vite preview",
16-
"format": "prettier --write \"src/**/*.{ts,tsx}\""
16+
"format": "prettier --write . --ignore-path .gitignore",
17+
"format:check": "prettier --check . --ignore-path .gitignore"
1718
},
1819
"dependencies": {
1920
"@radix-ui/react-label": "^2.1.2",

vite.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import path from "path";
2-
import tailwindcss from "@tailwindcss/vite";
3-
import { defineConfig } from "vite";
4-
import react from "@vitejs/plugin-react";
1+
import path from 'path';
2+
import tailwindcss from '@tailwindcss/vite';
3+
import { defineConfig } from 'vite';
4+
import react from '@vitejs/plugin-react';
55

66
export default defineConfig({
77
plugins: [react(), tailwindcss()],
88
resolve: {
99
alias: {
10-
"@": path.resolve(__dirname, "./src"),
10+
'@': path.resolve(__dirname, './src'),
1111
},
1212
},
1313
});

0 commit comments

Comments
 (0)