Skip to content

Commit 1551626

Browse files
CI fix + new attempt at auto style/syntax fix
1 parent ba6b55f commit 1551626

File tree

5 files changed

+98
-86
lines changed

5 files changed

+98
-86
lines changed

.github/workflows/reactjs_ci_cd.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
- name: Install dependencies
2323
run: npm install
2424

25-
- name: Run ESLint
26-
run: npx --prefix ./ eslint ./frontend --ext .js,.jsx,.ts,.tsx
25+
- name: Run ESLint and auto-fix syntax/style errors
26+
run: npx eslint --config ./frontend/eslint.config.js --fix frontend
2727

28+
# Applies syntax/style fixes from ESLint as a commit
29+
- name: Commit and push changes
30+
run: |
31+
git config --global user.name "GitHub Actions"
32+
git config --global user.email "actions@github.com"
33+
git add .
34+
git commit -m "Auto-fix ESLint issues"
35+
git push
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

frontend/eslint.config.js

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

77
export default [
88
{ ignores: ['dist'] },
99
{
10-
files: ['**/*.{js,jsx,ts,tsx}'], // Added ts, tsx support
10+
files: ['**/*.{js,jsx,ts,tsx}'],
1111
languageOptions: {
12-
ecmaVersion: 'latest', // Unified the ECMA version declaration
12+
ecmaVersion: 2020,
1313
globals: globals.browser,
1414
parserOptions: {
15+
ecmaVersion: 'latest',
1516
ecmaFeatures: { jsx: true },
1617
sourceType: 'module',
1718
},
1819
},
1920
settings: { react: { version: '18.3' } },
20-
plugins: [
21+
plugins: {
2122
react,
22-
reactHooks,
23-
reactRefresh,
24-
], // Changed plugins to an array as required by ESLint v9
23+
'react-hooks': reactHooks,
24+
'react-refresh': reactRefresh,
25+
},
2526
rules: {
2627
...js.configs.recommended.rules,
2728
...react.configs.recommended.rules,
2829
...react.configs['jsx-runtime'].rules,
2930
...reactHooks.configs.recommended.rules,
3031
'react/jsx-no-target-blank': 'off',
31-
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
32+
'react-refresh/only-export-components': [
33+
'warn',
34+
{ allowConstantExport: true },
35+
],
3236
},
3337
},
34-
];
38+
]

frontend/package-lock.json

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

frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"@types/react": "^19.0.8",
2222
"@types/react-dom": "^19.0.3",
2323
"@vitejs/plugin-react": "^4.3.4",
24-
"eslint": "^9.19.0",
24+
"eslint": "^9.23.0",
2525
"eslint-plugin-react": "^7.37.4",
26-
"eslint-plugin-react-hooks": "^5.0.0",
27-
"eslint-plugin-react-refresh": "^0.4.18",
26+
"eslint-plugin-react-hooks": "^5.2.0",
27+
"eslint-plugin-react-refresh": "^0.4.19",
2828
"globals": "^15.14.0",
2929
"vite": "^6.1.0"
3030
}

frontend/src/Components/Contact.jsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ export default function Contact() {
33
return (
44
<>
55
<section class="contact-header">
6-
<div class="container">
7-
<h1 class="text-center fw-bold">Contact Us</h1>
8-
<p class="text-center text-muted">
6+
<div className="container">
7+
<h1 className="text-center fw-bold">Contact Us</h1>
8+
<p className="text-center text-muted">
99
Have questions? We’re here to help.
1010
</p>
1111
</div>
1212
</section>
1313

14-
<section class="contact-info container my-5">
15-
<div class="row">
16-
<div class="col-md-6">
14+
<section className="contact-info container my-5">
15+
<div className="row">
16+
<div className="col-md-6">
1717
<h3>Contact Information</h3>
1818
<p><strong>Email:</strong> support@lessonconnect.com</p>
1919
<p><strong>Phone:</strong> (702) 555-1234</p>
@@ -23,37 +23,37 @@ export default function Contact() {
2323
</p>
2424
<p><strong>Location:</strong> University of Nevada, Las Vegas</p>
2525
</div>
26-
<div class="col-md-6">
26+
<div className="col-md-6">
2727
<h3>Get in Touch</h3>
2828
<form>
29-
<div class="mb-3">
30-
<label for="name" class="form-label">Full Name</label>
29+
<div className="mb-3">
30+
<label htmlFor="name" className="form-label">Full Name</label>
3131
<input
3232
type="text"
33-
class="form-control"
33+
className="form-control"
3434
id="name"
3535
placeholder="Enter your name"
3636
/>
3737
</div>
38-
<div class="mb-3">
39-
<label for="email" class="form-label">Email Address</label>
38+
<div className="mb-3">
39+
<label htmlFor="email" className="form-label">Email Address</label>
4040
<input
4141
type="email"
42-
class="form-control"
42+
className="form-control"
4343
id="email"
4444
placeholder="Enter your email"
4545
/>
4646
</div>
47-
<div class="mb-3">
48-
<label for="message" class="form-label">Message</label>
47+
<div className="mb-3">
48+
<label htmlFor="message" className="form-label">Message</label>
4949
<textarea
50-
class="form-control"
50+
className="form-control"
5151
id="message"
5252
rows="4"
5353
placeholder="Type your message"
5454
></textarea>
5555
</div>
56-
<button type="submit" class="btn btn-primary">Send Message</button>
56+
<button type="submit" className="btn btn-primary">Send Message</button>
5757
</form>
5858
</div>
5959
</div>

0 commit comments

Comments
 (0)