Skip to content

More strict linters#255

Merged
spring1843 merged 6 commits into
mainfrom
more-strict-linters
Dec 1, 2025
Merged

More strict linters#255
spring1843 merged 6 commits into
mainfrom
more-strict-linters

Conversation

@spring1843

Copy link
Copy Markdown
Owner
  • more strict linter rules

Copilot AI review requested due to automatic review settings December 1, 2025 07:57
@netlify

netlify Bot commented Dec 1, 2025

Copy link
Copy Markdown

Deploy Preview for freedevtool ready!

Name Link
🔨 Latest commit 6a0cea8
🔍 Latest deploy log https://app.netlify.com/projects/freedevtool/deploys/692d4a78817d0b0008147dbe
😎 Deploy Preview https://deploy-preview-255--freedevtool.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR implements stricter linter rules across the codebase by enabling previously disabled ESLint rules and removing file-specific exceptions. The changes enforce better code quality through consistent return statements, proper handling of unused variables, and elimination of nested ternaries.

Key changes:

  • Enabled strict linting rules: consistent-return, @typescript-eslint/no-unused-vars, and react/prop-types changed from "off" to "error"
  • Removed all file-specific linter exception configurations for server files, config files, tool pages, and UI components
  • Replaced require() statements with ES6 imports in tailwind.config.ts

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eslint.config.js Enabled stricter linting rules and removed all file-specific exception configurations
tailwind.config.ts Replaced require() calls with ES6 imports for plugins
tests/e2e/tools/json-yaml-converter.spec.ts Removed unused _yamlOutput variable
dev-server/index.ts Removed unused imports and parameters (has issue - see comments)
client/src/components/ui/button.tsx Removed redundant buttonVariants re-export
client/src/components/ui/alert-dialog.tsx Updated import to use button-variants directly
client/src/components/ui/textarea.tsx Removed unused parameters and added data attribute type (has issue - see comments)
client/src/hooks/use-toast.ts Replaced const object with interface for ActionType
client/src/lib/url-parser.ts Changed array destructuring to use comma for unused variable
client/src/pages/tools/csv-to-json.tsx Changed unused variable prefix convention
client/src/pages/tools/qr-generator.tsx Added explicit return undefined for consistent-return compliance
client/src/pages/tools/browser-info.tsx Refactored nested ternaries into helper functions using useCallback
client/src/pages/tools/barcode-generator.tsx Added block scope braces to case statement
client/src/pages/tools/date-converter.tsx Added block scope braces to case statement
client/src/pages/tools/unicode-characters.tsx Replaced nested ternary with IIFE switch statement and added case block braces
client/src/pages/tools/world-clock.tsx Fixed apostrophe encoding using '
client/src/pages/tools/webcam-test.tsx Replaced nested ternary with IIFE, fixed quote encoding, updated button styling (has issue - see comments)
client/src/pages/tools/text-split.tsx Fixed quote encoding using "
client/src/pages/tools/stopwatch.tsx Replaced nested ternary with conditional logic in map callback
client/src/pages/tools/password-generator.tsx Replaced nested ternary with conditional logic in map callback
client/src/pages/tools/microphone-test.tsx Replaced nested ternary with IIFE
client/src/pages/tools/metronome.tsx Replaced nested ternary with conditional logic in map callback
client/src/pages/tools/md5-hash.tsx Fixed apostrophe encoding using '
client/src/pages/tools/lorem-generator.tsx Fixed quote encoding using "
client/src/pages/tools/keyboard-test.tsx Fixed apostrophe and quote encoding
client/src/pages/tools/compound-interest.tsx Replaced nested ternary with IIFE switch-style logic

Comment on lines +305 to +313
<ToolButton
variant="custom"
onClick={startCamera}
tooltip="Start the camera preview"
icon={<Play className="w-4 h-4 mr-2" />}
className="bg-green-600 hover:bg-green-700 text-white disabled:opacity-50"
>
Start Camera
</ToolButton>

Copilot AI Dec 1, 2025

Copy link

Choose a reason for hiding this comment

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

The disabled attribute was removed when refactoring to an IIFE. The original code had disabled={devices.length === 0} on this button to prevent starting the camera when no devices are available. This attribute should be restored:

<ToolButton
  variant="custom"
  onClick={startCamera}
  disabled={devices.length === 0}
  tooltip="Start the camera preview"
  icon={<Play className="w-4 h-4 mr-2" />}
  className="bg-green-600 hover:bg-green-700 text-white disabled:opacity-50"
>
  Start Camera
</ToolButton>

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +120
({
className,
value,
onChange,
theme = "light",
lineWrapping = false,
fixedHeight = true,
...props
}) => {

Copilot AI Dec 1, 2025

Copy link

Choose a reason for hiding this comment

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

The ref parameter should not be completely removed from a component using React.forwardRef. Even if the ref isn't used internally, forwardRef expects the component function to accept both props and ref as parameters. The parameter should remain but can be prefixed with underscore to indicate it's intentionally unused:

const TextArea = React.forwardRef<HTMLDivElement, TextAreaProps>(
  (
    {
      className,
      value,
      onChange,
      theme = "light",
      lineWrapping = false,
      fixedHeight = true,
      ...props
    },
    _ref
  ) => {
Suggested change
({
className,
value,
onChange,
theme = "light",
lineWrapping = false,
fixedHeight = true,
...props
}) => {
(
{
className,
value,
onChange,
theme = "light",
lineWrapping = false,
fixedHeight = true,
...props
},
_ref
) => {

Copilot uses AI. Check for mistakes.
Comment thread dev-server/index.ts
_req: Request,
res: Response,
_next: NextFunction
res: Response

Copilot AI Dec 1, 2025

Copy link

Choose a reason for hiding this comment

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

Express error handling middleware requires exactly 4 parameters (err, req, res, next) to be recognized as an error handler. Removing the next parameter will cause Express to treat this as regular middleware instead of an error handler, breaking error handling functionality. The parameter should be restored, prefixed with underscore if unused:

app.use(
  (
    err: Error & { status?: number; statusCode?: number },
    _req: Request,
    res: Response,
    _next: NextFunction
  ) => {

See Express documentation: https://expressjs.com/en/guide/error-handling.html

Suggested change
res: Response
res: Response,
_next: express.NextFunction

Copilot uses AI. Check for mistakes.
@spring1843 spring1843 merged commit 9376738 into main Dec 1, 2025
11 checks passed
@spring1843 spring1843 deleted the more-strict-linters branch December 1, 2025 08:03
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.

2 participants