Skip to content

Commit 948266d

Browse files
feat: add lint check workflow and lint all files (#2553)
* feat: added lint check worlfkow * feat: lint all files * chore: update lint workflow * chore: update lint workflow --------- Co-authored-by: Thinh <ngocthinhdp@gmail.com>
1 parent f5286ce commit 948266d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+7493
-9881
lines changed

.github/workflows/lint.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Lint Check
2+
3+
on:
4+
push:
5+
branches: main
6+
paths:
7+
- 'web/frontend/**'
8+
- 'web/personas-open-source/**'
9+
pull_request:
10+
branches: main
11+
paths:
12+
- 'web/frontend/**'
13+
- 'web/personas-open-source/**'
14+
15+
jobs:
16+
lint-frontend:
17+
name: Lint Frontend
18+
runs-on: ubuntu-latest
19+
defaults:
20+
run:
21+
working-directory: ./web/frontend
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '18'
31+
cache: 'npm'
32+
cache-dependency-path: './web/frontend/package-lock.json'
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Run ESLint
38+
run: npm run lint
39+
40+
- name: Check Prettier formatting
41+
run: npm run lint:format -- --check
42+
43+
lint-personas:
44+
name: Lint Personas Open Source
45+
runs-on: ubuntu-latest
46+
defaults:
47+
run:
48+
working-directory: ./web/personas-open-source
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '18'
58+
cache: 'npm'
59+
cache-dependency-path: './web/personas-open-source/package-lock.json'
60+
61+
- name: Install dependencies
62+
run: npm ci --legacy-peer-deps
63+
64+
- name: Run ESLint
65+
run: npm run lint

web/frontend/.eslintrc.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ module.exports = {
3737
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
3838
'react/react-in-jsx-scope': 'off',
3939
'jsx-a11y/accessible-emoji': 'off',
40+
'jsx-a11y/label-has-associated-control': 'off',
41+
'jsx-a11y/no-static-element-interactions': 'off',
42+
'jsx-a11y/click-events-have-key-events': 'off',
4043
'react/prop-types': 'off',
4144
'@typescript-eslint/explicit-function-return-type': 'off',
4245
'@typescript-eslint/ban-ts-comment': 'off',
4346
'simple-import-sort/imports': 'off',
4447
'simple-import-sort/exports': 'off',
48+
// Add warnings for specific rules
49+
'react/no-unescaped-entities': 'warn',
50+
'jsx-a11y/heading-has-content': 'warn',
4551
'jsx-a11y/anchor-is-valid': [
4652
'error',
4753
{

web/frontend/.prettierrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ module.exports = {
55
printWidth: 90,
66
tabWidth: 2,
77
endOfLine: 'auto',
8+
htmlWhitespaceSensitivity: 'css',
9+
singleAttributePerLine: false,
810
};

web/frontend/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)