File tree 2 files changed +46
-1
lines changed
2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : CI and Lint
2
+
3
+ on :
4
+ pull_request :
5
+ branches : [ main ]
6
+
7
+ jobs :
8
+ lint :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Checkout code
12
+ uses : actions/checkout@v4
13
+ with :
14
+ fetch-depth : 0
15
+
16
+ - name : Set up Node.js
17
+ uses : actions/setup-node@v4
18
+ with :
19
+ node-version : 18
20
+
21
+ - name : Install dependencies
22
+ run : npm ci
23
+
24
+ - name : Lint changed files
25
+ if : github.event_name == 'pull_request'
26
+ run : |
27
+ git fetch origin ${{ github.base_ref }}
28
+ FILES=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} | grep -E '\.(js|jsx|ts|tsx|html|css)$' || true)
29
+ if [ -n "$FILES" ]; then
30
+ echo "Linting changed files:"
31
+ echo "$FILES"
32
+ echo "$FILES" | xargs npx prettier --check
33
+ echo "$FILES" | grep -E '\.(js|jsx|ts|tsx)$' | xargs npx eslint || true
34
+ else
35
+ echo "No relevant files changed."
36
+ fi
37
+ env :
38
+ CI : true
Original file line number Diff line number Diff line change 1
1
{
2
- "parser" : " html"
2
+ "semi" : true ,
3
+ "singleQuote" : true ,
4
+ "tabWidth" : 2 ,
5
+ "useTabs" : false ,
6
+ "trailingComma" : " es5" ,
7
+ "bracketSpacing" : true ,
8
+ "arrowParens" : " always" ,
9
+ "printWidth" : 80
3
10
}
You can’t perform that action at this time.
0 commit comments