Skip to content

[Refactor:Developer] Clean up ESLint globals in JS files.#12618

Merged
williamjallen merged 1 commit into
Submitty:mainfrom
Benny-Dav:benny/refactor-eslint-globals
Mar 23, 2026
Merged

[Refactor:Developer] Clean up ESLint globals in JS files.#12618
williamjallen merged 1 commit into
Submitty:mainfrom
Benny-Dav:benny/refactor-eslint-globals

Conversation

@Benny-Dav

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Partially adresses #10506 . Several JS files use '//eslint-disable-next-line no-undef' comments instead of properly declaring globals in '/global/' comments at the top of each file.

What is the New Behavior?

Added proper '/global/' declarations and removed '/eslint-disable-next-line no-undef/' comments in:

  • docker_interface.js
  • latedays.js
  • plagiarism.js
  • user-profile.js

Files not included in this PR

  • server.js - The no-undef warnings in this file stem from undeclared local variables that require 'let' or 'const' declarations, not global additions. This change might be best suited for a separate PR

-forum.js - This file was excluded due to its large size and high number of instances, which will be tackled in a follow-up PR.

-PDFInitToolbar.js - This file no longer exists in the codebase

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Open the modified files and verify that // eslint-disable-next-line no-undef comments have been removed.

  2. Verify that the variables referenced on the lines following removed lint comments are now declared in the global comment at the top of each file.

  3. Confirm that other 'eslint-disable' comments, for instance 'no-restricted-syntax', are untouched.

Automated Testing & Documentation

ESLint passes on all modified files. No functional changes, only lint comments were cleaned up and global declarations added.

Other information

This is not a breaking change.
No migrations or security concerns.

@github-project-automation github-project-automation Bot moved this to Seeking Reviewer in Submitty Development Mar 21, 2026
@JManion32 JManion32 changed the title [Refactor: Developer] Clean up ESLint globals in JS files. [Refactor:Developer] Clean up ESLint globals in JS files. Mar 21, 2026
@codecov

codecov Bot commented Mar 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.66%. Comparing base (9cb25d6) to head (3715559).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12618   +/-   ##
=========================================
  Coverage     21.66%   21.66%           
  Complexity     9637     9637           
=========================================
  Files           268      268           
  Lines         36222    36222           
  Branches        487      487           
=========================================
  Hits           7847     7847           
  Misses        27892    27892           
  Partials        483      483           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.68% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution!

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Mar 23, 2026
@williamjallen
williamjallen merged commit c64b708 into Submitty:main Mar 23, 2026
49 of 51 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Mar 23, 2026
williamjallen added a commit that referenced this pull request Mar 23, 2026
### Why is this Change Important & Necessary?
Partially addresses #10506 .  
forum.js file uses // eslint-disable-next-line no-undef comments instead
of properly declaring globals in '/*global*/' comments at the top of the
file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed //
eslint-disable-next-line no-undef comments for global variables in:

- forum.js

### Remaining 'no-undef' comments
Some // eslint-disable-next-line no-undef comments remain in forum.js
for the variables (box, newelement, newcatcolorpicker, unread_marked,
thread_id) that are undeclared local variables , not global variables.
Similarly, server.js file (noted in pr #12618 ) had no global variables
but only local undeclared variables.
Both fixes would require functional changes of declaring let and const
variables, and possibly affecting any global dependencies on those
variables.

### Clarification to close issue
Should these local variable fixes be handled in the next PR to close
this issue or will they be addressed as a separate issue?

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified file and verify that more global variables have
been added at the top of the file.
         
2. Verify that // eslint-disable-next-line no-undef comments have been
removed from lines preceding global variables.

3. Confirm that other eslint comments, for instance
'no-restricted-syntax', and comments before local variables (box,
newelement, newcatcolorpicker, unread_marked, thread_id) are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.

Co-authored-by: William Allen <[email protected]>
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Mar 25, 2026
…2618)

### Why is this Change Important & Necessary?
Partially adresses Submitty#10506 . Several JS files use
'//eslint-disable-next-line no-undef' comments instead of properly
declaring globals in '/*global*/' comments at the top of each file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed
'/*eslint-disable-next-line no-undef*/' comments in:

- docker_interface.js
- latedays.js
- plagiarism.js
- user-profile.js

### Files not included in this PR
- server.js - The no-undef warnings in this file stem from undeclared
local variables that require 'let' or 'const' declarations, not global
additions. This change might be best suited for a separate PR

-forum.js - This file was excluded due to its large size and high number
of instances, which will be tackled in a follow-up PR.

-PDFInitToolbar.js - This file no longer exists in the codebase

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified files and verify that `// eslint-disable-next-line
no-undef` comments have been removed.
         
2. Verify that the variables referenced on the lines following removed
lint comments are now declared in the global comment at the top of each
file.

3. Confirm that other 'eslint-disable' comments, for instance
'no-restricted-syntax', are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Mar 25, 2026
)

### Why is this Change Important & Necessary?
Partially addresses Submitty#10506 .  
forum.js file uses // eslint-disable-next-line no-undef comments instead
of properly declaring globals in '/*global*/' comments at the top of the
file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed //
eslint-disable-next-line no-undef comments for global variables in:

- forum.js

### Remaining 'no-undef' comments
Some // eslint-disable-next-line no-undef comments remain in forum.js
for the variables (box, newelement, newcatcolorpicker, unread_marked,
thread_id) that are undeclared local variables , not global variables.
Similarly, server.js file (noted in pr Submitty#12618 ) had no global variables
but only local undeclared variables.
Both fixes would require functional changes of declaring let and const
variables, and possibly affecting any global dependencies on those
variables.

### Clarification to close issue
Should these local variable fixes be handled in the next PR to close
this issue or will they be addressed as a separate issue?

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified file and verify that more global variables have
been added at the top of the file.
         
2. Verify that // eslint-disable-next-line no-undef comments have been
removed from lines preceding global variables.

3. Confirm that other eslint comments, for instance
'no-restricted-syntax', and comments before local variables (box,
newelement, newcatcolorpicker, unread_marked, thread_id) are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.

Co-authored-by: William Allen <[email protected]>
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Mar 29, 2026
…2618)

### Why is this Change Important & Necessary?
Partially adresses Submitty#10506 . Several JS files use
'//eslint-disable-next-line no-undef' comments instead of properly
declaring globals in '/*global*/' comments at the top of each file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed
'/*eslint-disable-next-line no-undef*/' comments in:

- docker_interface.js
- latedays.js
- plagiarism.js
- user-profile.js

### Files not included in this PR
- server.js - The no-undef warnings in this file stem from undeclared
local variables that require 'let' or 'const' declarations, not global
additions. This change might be best suited for a separate PR

-forum.js - This file was excluded due to its large size and high number
of instances, which will be tackled in a follow-up PR.

-PDFInitToolbar.js - This file no longer exists in the codebase

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified files and verify that `// eslint-disable-next-line
no-undef` comments have been removed.
         
2. Verify that the variables referenced on the lines following removed
lint comments are now declared in the global comment at the top of each
file.

3. Confirm that other 'eslint-disable' comments, for instance
'no-restricted-syntax', are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Mar 29, 2026
)

### Why is this Change Important & Necessary?
Partially addresses Submitty#10506 .  
forum.js file uses // eslint-disable-next-line no-undef comments instead
of properly declaring globals in '/*global*/' comments at the top of the
file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed //
eslint-disable-next-line no-undef comments for global variables in:

- forum.js

### Remaining 'no-undef' comments
Some // eslint-disable-next-line no-undef comments remain in forum.js
for the variables (box, newelement, newcatcolorpicker, unread_marked,
thread_id) that are undeclared local variables , not global variables.
Similarly, server.js file (noted in pr Submitty#12618 ) had no global variables
but only local undeclared variables.
Both fixes would require functional changes of declaring let and const
variables, and possibly affecting any global dependencies on those
variables.

### Clarification to close issue
Should these local variable fixes be handled in the next PR to close
this issue or will they be addressed as a separate issue?

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified file and verify that more global variables have
been added at the top of the file.
         
2. Verify that // eslint-disable-next-line no-undef comments have been
removed from lines preceding global variables.

3. Confirm that other eslint comments, for instance
'no-restricted-syntax', and comments before local variables (box,
newelement, newcatcolorpicker, unread_marked, thread_id) are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.

Co-authored-by: William Allen <[email protected]>
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 14, 2026
…2618)

### Why is this Change Important & Necessary?
Partially adresses Submitty#10506 . Several JS files use
'//eslint-disable-next-line no-undef' comments instead of properly
declaring globals in '/*global*/' comments at the top of each file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed
'/*eslint-disable-next-line no-undef*/' comments in:

- docker_interface.js
- latedays.js
- plagiarism.js
- user-profile.js

### Files not included in this PR
- server.js - The no-undef warnings in this file stem from undeclared
local variables that require 'let' or 'const' declarations, not global
additions. This change might be best suited for a separate PR

-forum.js - This file was excluded due to its large size and high number
of instances, which will be tackled in a follow-up PR.

-PDFInitToolbar.js - This file no longer exists in the codebase

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified files and verify that `// eslint-disable-next-line
no-undef` comments have been removed.
         
2. Verify that the variables referenced on the lines following removed
lint comments are now declared in the global comment at the top of each
file.

3. Confirm that other 'eslint-disable' comments, for instance
'no-restricted-syntax', are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 14, 2026
)

### Why is this Change Important & Necessary?
Partially addresses Submitty#10506 .  
forum.js file uses // eslint-disable-next-line no-undef comments instead
of properly declaring globals in '/*global*/' comments at the top of the
file.

### What is the New Behavior?
Added proper '/*global*/' declarations and removed //
eslint-disable-next-line no-undef comments for global variables in:

- forum.js

### Remaining 'no-undef' comments
Some // eslint-disable-next-line no-undef comments remain in forum.js
for the variables (box, newelement, newcatcolorpicker, unread_marked,
thread_id) that are undeclared local variables , not global variables.
Similarly, server.js file (noted in pr Submitty#12618 ) had no global variables
but only local undeclared variables.
Both fixes would require functional changes of declaring let and const
variables, and possibly affecting any global dependencies on those
variables.

### Clarification to close issue
Should these local variable fixes be handled in the next PR to close
this issue or will they be addressed as a separate issue?

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Open the modified file and verify that more global variables have
been added at the top of the file.
         
2. Verify that // eslint-disable-next-line no-undef comments have been
removed from lines preceding global variables.

3. Confirm that other eslint comments, for instance
'no-restricted-syntax', and comments before local variables (box,
newelement, newcatcolorpicker, unread_marked, thread_id) are untouched.

### Automated Testing & Documentation
ESLint passes on all modified files. No functional changes, only lint
comments were cleaned up and global declarations added.

### Other information
This is not a breaking change.
No migrations or security concerns.

Co-authored-by: William Allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants