Skip to content

Commit 13ddbc8

Browse files
authored
fix lint/formatting, seperate test action (#489)
1 parent 325a62e commit 13ddbc8

File tree

19 files changed

+148
-107
lines changed

19 files changed

+148
-107
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Build & Test
1+
name: Build
22

33
on:
44
push:
55
branches: [main]
6-
pull_request:
7-
branches: [main]
86

97
jobs:
108
build:
@@ -19,21 +17,4 @@ jobs:
1917
node-version: '22'
2018
cache: 'npm'
2119
- run: npm install
22-
23-
- name: Check Prettier formatting
24-
run: npx prettier --check src/
25-
# Let fail for now
26-
continue-on-error: true
27-
28-
- name: Run ESLint
29-
run: npx eslint src/
30-
# Let fail for now
31-
continue-on-error: true
32-
33-
- run: npm run test-coverage
3420
- run: npm run build
35-
36-
- name: Coveralls
37-
uses: coverallsapp/github-action@master
38-
with:
39-
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test & Lint
2+
3+
on:
4+
pull_request:
5+
branches: ['main']
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v5
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v6
16+
with:
17+
node-version: '22'
18+
cache: 'npm'
19+
20+
- run: npm install
21+
22+
- name: Check Prettier formatting
23+
run: npx prettier --check vite.config.ts src/
24+
25+
- name: Run ESLint
26+
run: npx eslint vite.config.ts src/
27+
28+
- run: npm run test-coverage
29+
- run: npm run build
30+
- name: Coveralls
31+
uses: coverallsapp/github-action@master
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}

eslint.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ export default defineConfig([
4343
'react/jsx-uses-react': 'off',
4444
'react/react-in-jsx-scope': 'off',
4545
'react/no-unknown-property': ['error', { ignore: ['css'] }],
46-
'no-unused-vars': [
46+
'@typescript-eslint/no-unused-vars': [
4747
'error',
4848
{
49-
argsIgnorePattern: '^_',
50-
varsIgnorePattern: '^_',
51-
caughtErrorsIgnorePattern: '^_',
49+
argsIgnorePattern: '^_|^e$',
50+
varsIgnorePattern: '^_|^e$',
51+
caughtErrorsIgnorePattern: '^_|^e$',
5252
},
5353
],
5454
// Turning these off for now to clean up warnings

src/app.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,16 @@ export let routes: RouteObject[] = [];
1818
export let router: ReturnType<typeof createBrowserRouter>;
1919

2020
if (element) {
21-
const routes = [
21+
routes = [
2222
{
2323
path: '/*',
2424
element: (
2525
<TsmlUI
2626
google={element.getAttribute('data-google') || undefined}
27-
// eslint-disable-next-line no-undef
2827
settings={
2928
typeof tsml_react_config === 'undefined'
3029
? undefined
31-
: // eslint-disable-next-line no-undef
32-
tsml_react_config
30+
: tsml_react_config
3331
}
3432
src={element.getAttribute('data-src') || undefined}
3533
timezone={element.getAttribute('data-timezone') || undefined}

src/components/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default function Button({
2222
type === 'in-person'
2323
? buttonDirectionsCss
2424
: type === 'online'
25-
? buttonJoinCss
26-
: buttonCss
25+
? buttonJoinCss
26+
: buttonCss
2727
}
2828
href={href}
2929
onClick={onClick}

src/components/Controls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default function Controls() {
133133
distance:
134134
mode === 'search'
135135
? undefined
136-
: input.distance ?? settings.distance_default,
136+
: (input.distance ?? settings.distance_default),
137137
mode,
138138
region: mode === 'search' ? input.region : [],
139139
search,

src/components/Dropdown.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ import {
88

99
import { useNavigate } from 'react-router-dom';
1010
import { formatUrl, getIndexByKey, formatString as i18n } from '../helpers';
11-
import { type Data, useData, useInput, useLocation, useSettings } from '../hooks';
11+
import {
12+
type Data,
13+
useData,
14+
useInput,
15+
useLocation,
16+
useSettings,
17+
} from '../hooks';
1218
import { dropdownButtonCss, dropdownCss } from '../styles';
1319
import type { Index } from '../types';
1420

src/components/Map.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import 'leaflet/dist/leaflet.css';
55
import { MapContainer, Marker, Popup, TileLayer, useMap } from 'react-leaflet';
66

77
import { formatDirectionsUrl } from '../helpers';
8-
import { useData, useError, useFilter, useInput, useLocation, useSettings } from '../hooks';
8+
import {
9+
useData,
10+
useError,
11+
useFilter,
12+
useInput,
13+
useLocation,
14+
useSettings,
15+
} from '../hooks';
916
import { mapCss, mapPopupMeetingsCss } from '../styles';
1017
import type { MapLocation } from '../types';
1118
import Button from './Button';

src/components/Meeting.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ export default function Meeting() {
113113
const feedback_url = meeting.feedback_url
114114
? meeting.feedback_url
115115
: feedback_emails.length
116-
? formatFeedbackEmail({
117-
feedback_emails,
118-
meeting,
119-
settings,
120-
strings,
121-
})
122-
: undefined;
116+
? formatFeedbackEmail({
117+
feedback_emails,
118+
meeting,
119+
settings,
120+
strings,
121+
})
122+
: undefined;
123123

124124
// format time string (duration? or appointment?)
125125
const formatTime = (start?: DateTime, end?: DateTime) => {

src/components/Table.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import InfiniteScroll from 'react-infinite-scroller';
55
import { useNavigate } from 'react-router-dom';
66

77
import { formatUrl, formatString as i18n } from '../helpers';
8-
import { useData, useError, useFilter, useInput, useLocation, useSettings } from '../hooks';
8+
import {
9+
useData,
10+
useError,
11+
useFilter,
12+
useInput,
13+
useLocation,
14+
useSettings,
15+
} from '../hooks';
916
import {
1017
tableChicletCss,
1118
tableChicletsCss,

0 commit comments

Comments
 (0)