Skip to content

Commit 4e02ca3

Browse files
chore/ci: setup linters and their github action (#246)
* complete setting up the server linter * ci: server lint * ci: client linter * update client linter * update client linter * remove type module from npm for build issue * refactor * fix package-lock.json
1 parent afc5ed8 commit 4e02ca3

File tree

8 files changed

+3128
-2007
lines changed

8 files changed

+3128
-2007
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Quality Checks
2+
permissions:
3+
contents: read
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
lint-server:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
cache: 'npm'
20+
cache-dependency-path: '**/package-lock.json'
21+
22+
- name: Install dependencies
23+
run: cd server && npm ci
24+
25+
- name: Run ESLint
26+
run: cd server && npm run lint
27+
28+
lint-client:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '22'
38+
cache: 'npm'
39+
cache-dependency-path: '**/package-lock.json'
40+
41+
- name: Install client dependencies
42+
run: cd client && npm ci
43+
44+
- name: Run client ESLint
45+
run: cd client && npm run lint

client/.eslintrc.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

client/eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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';
6+
import { globalIgnores } from 'eslint/config';
7+
8+
export default tseslint.config([
9+
globalIgnores(['dist', 'node_modules']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs['recommended-latest'],
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: {
21+
...globals.browser,
22+
},
23+
},
24+
rules: {
25+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
26+
},
27+
},
28+
]);

0 commit comments

Comments
 (0)