Skip to content

Tool: JSHint (Static Analysis)#130

Closed
saisankhe wants to merge 73 commits into
mainfrom
tool-jshint
Closed

Tool: JSHint (Static Analysis)#130
saisankhe wants to merge 73 commits into
mainfrom
tool-jshint

Conversation

@saisankhe

Copy link
Copy Markdown

JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module.

Installation: Installed via npm install --save-dev jshint and ran with npx jshint src/

Evidence: See jshint-output.txt for full output. 30488 warnings were produced across the codebase.

Pros of JSHint:

  • It is very easy to install and run. It only took one npm install and one command.
  • It is very fast. It scanned the entire codebase in seconds.
  • It catches a wide range of potential issues like unused variables, missing strict equality and undefined globals
  • It is highly configurable via .jshintrc, package.json or inline directives.

Cons of JSHint:

  • Most of the 30488 warnings produced were not actual bugs, just outdated syntax complaints which makes it hard to find actual issues without configuration.
  • Does not recognise Node.js globals by default, leading to many false positives around require, module and process.
  • Defaults to ES5 and hence flags modern JavaScript features like const, arrow functions, and async/await as errors.

Customisation:

  • JSHint can be configured through a .jshintrc config file, package.json under jshintConfig or inline comments
  • Eventually, teams can enable options like "undef":true to flag undefined variables and "unused": true to catch unused variables
  • Specific warnings can be suppressed using inline comments

Quantitative Evidence:

  • 30,488 warnings produced in total
  • The majority were ES5 syntax warnings
  • The second most common category was undefined Node.js globals

K1ngHungry and others added 30 commits February 3, 2026 16:05
refactored postsController.redirectToPost into helper functions to re…
refactor: copy P1 infinitescroll changes
Reduced complexity of authentication - ssura 1b commit
added poll database for the poll creation feature
Connected database to backend api for polls
Create poll view and add new poll UI
ajhua-dotcom and others added 29 commits February 24, 2026 23:05
Description:
Added poll voting to the database layer with duplicate vote prevention. All poll GET responses with a hasVoted field so the frontend knows whether the current user has already voted. Connected the vote endpoint through the controller and route layers.

Changes:
src/polls.js — Added Polls.vote() with duplicate vote prevention, vote counting, and response tracking. Added uid parameter to get(), getAll(), and getMultiple() to attach a hasVoted boolean to each poll response.
src/controllers/polls.js — Added pollsController.vote handler with optionId validation. Updated get and getAll to pass req.uid through to the data layer.
src/routes/polls.js — Mounted POST /api/polls/:pollId/vote behind ensureLoggedIn middleware.
test/polls.js (new) — Added 13 test cases covering poll creation, retrieval, voting, duplicate vote rejection, multi-user voting, invalid option handling, and deletion.
Testing:
Tests in test/polls.js all passed. Further end-to-end testing will be done after frontend is integrated.
Added poll documentation to UserGuide.md
Feature: autoComplete works as intended and is ready to merge (see above comment)
Added a new section for the Search Autocomplete implementation, detailing its features, user flow, technical flow, database schema, API examples, and testing procedures.
Expand User Guide with Search Autocomplete details.
Fix: link to the test file was not working so added a new working link
Update UserGuide.md to include working link for autocomplete test file
Autocomplete Bug Fixes and Enhancements
Update docker-compose-redis.yml
@saisankhe saisankhe closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants