More strict linters#255
Conversation
spring1843
commented
Dec 1, 2025
- more strict linter rules
✅ Deploy Preview for freedevtool ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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, andreact/prop-typeschanged 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 |
| <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> |
There was a problem hiding this comment.
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>| ({ | ||
| className, | ||
| value, | ||
| onChange, | ||
| theme = "light", | ||
| lineWrapping = false, | ||
| fixedHeight = true, | ||
| ...props | ||
| }) => { |
There was a problem hiding this comment.
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
) => {| ({ | |
| className, | |
| value, | |
| onChange, | |
| theme = "light", | |
| lineWrapping = false, | |
| fixedHeight = true, | |
| ...props | |
| }) => { | |
| ( | |
| { | |
| className, | |
| value, | |
| onChange, | |
| theme = "light", | |
| lineWrapping = false, | |
| fixedHeight = true, | |
| ...props | |
| }, | |
| _ref | |
| ) => { |
| _req: Request, | ||
| res: Response, | ||
| _next: NextFunction | ||
| res: Response |
There was a problem hiding this comment.
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
| res: Response | |
| res: Response, | |
| _next: express.NextFunction |