Skip to content

DYN-10448 Fix lint scripts in the DynamoHome repo#88

Open
danvelazco27 wants to merge 2 commits intoDynamoDS:masterfrom
danvelazco27:DYN-10448
Open

DYN-10448 Fix lint scripts in the DynamoHome repo#88
danvelazco27 wants to merge 2 commits intoDynamoDS:masterfrom
danvelazco27:DYN-10448

Conversation

@danvelazco27
Copy link
Copy Markdown
Collaborator

@danvelazco27 danvelazco27 commented Apr 30, 2026

PR Description

Summary

This PR focuses on making linting fully reliable and green across the codebase, while preserving runtime behavior.
It resolves previous ESLint execution/parsing issues, aligns TypeScript linting behavior, and applies the required code-level suppressions and type cleanups to reach a clean lint run.

What Changed

  1. Lint tooling and configuration hardening
  • Updated lint scripts to target explicit JS/TS glob patterns in source and tests.
  • Added TypeScript ESLint parser/plugin support and React Hooks lint plugin.
  • Extended ESLint config with JSX runtime, TypeScript recommended rules, and React Hooks recommended rules.
  • Added TypeScript-specific overrides to avoid false positives:
    • disabled no-undef for TS files
    • disabled react/prop-types for TS files
    • replaced core no-unused-vars with @typescript-eslint/no-unused-vars
  1. TypeScript project/type support updates
  • Updated TypeScript include configuration to cover source, tests, and shared types.
  • Added module declaration for plain CSS imports to prevent TS module resolution errors.
  1. Codebase lint remediation
  • Applied formatting and lint-oriented cleanups across components and tests.
  • Added targeted inline ESLint exceptions where needed (instead of broad global disables), including:
    • selected hooks dependency warnings
    • selected require-import warnings in host-integration paths
    • selected prefer-const/no-unused/no-explicit-any cases where intentional
  • Replaced multiple test-side any usages with safer unknown-based typing patterns.
  1. Test infrastructure adjustment
  • Updated Playwright local worker setting to improve local execution throughput while preserving CI behavior.

Outcome

  • npm run lint:check passes successfully on this branch.
  • Lint behavior is now consistent for TS/TSX files and less noisy (fewer false positives).
  • Changes are primarily lint/tooling/type-safety focused, with no intended product feature changes.

Scope / Impact

  • Large file touch count is mainly due to lint-driven formatting and targeted compliance edits.
  • Functional risk is low; most changes are static-analysis and typing related.

Validation Performed

  • Full lint check run and passing.
  • Additional rule-focused spot checks were run during remediation to confirm override necessity (no-undef, react/prop-types, and no-unused-vars behavior in TS).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 aims to make linting reliable/green across the repo by hardening ESLint/TS config and applying lint-driven typing/formatting fixes across source and tests.

Changes:

  • Updated ESLint configuration and npm lint scripts to properly lint JS/TS/TSX and add TypeScript + React Hooks lint support.
  • Expanded TypeScript project coverage (tsconfig + CSS module declarations) to reduce TS resolution errors.
  • Remediated lint issues across components/tests via formatting, safer unknown typings, and targeted suppressions.

Reviewed changes

Copilot reviewed 37 out of 45 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
types/index.d.ts Adds TS module declarations (incl. CSS).
tsconfig.json Expands TS include set (now includes tests/types).
tests/unit/utility.test.ts Replaces any with safer unknown cast.
tests/unit/SettingsContext.test.tsx Replaces any with unknown + narrowing.
tests/unit/Samples/SamplesGrid.test.tsx Removes any in mocked component props.
tests/unit/Samples/PageSamples.test.tsx Tightens mock typing (unknown + cast).
tests/unit/Samples/CustomSampleFirstCellRenderer.test.tsx Avoids any in FC cast.
tests/unit/Recent/PageRecent.test.tsx Tightens mock component typing.
tests/unit/Recent/GraphTable.test.tsx Uses unknown[] + explicit cast for render.
tests/unit/Recent/CustomNameCellRenderer.test.tsx Avoids any spread via Record cast.
tests/unit/Learning/PageLearning.test.tsx Adds ReactNode typing in mocks.
tests/unit/LayoutContainer.test.tsx Adds ReactNode typing + safer mock props.
tests/unit/App.test.tsx Adds ReactNode typing in SplitPane mock.
src/index.tsx Formatting-only render indentation.
src/functions/utility.ts Adds lint suppression around any parameter.
src/functions/placeholder.ts Formatting-only switch indentation.
src/components/Sidebar/Sidebar.tsx Formatting-only reindent + quotes consistency.
src/components/Sidebar/CustomDropDown.tsx Lint-driven cleanup + suppressions.
src/components/SettingsContext.tsx Formatting + suppressions for any context.
src/components/Samples/SamplesTable.tsx Lint suppression + formatting changes.
src/components/Samples/SamplesGridItem.tsx Formatting-only reindent.
src/components/Samples/SamplesGrid.tsx Formatting + quote normalization.
src/components/Samples/PageSamples.tsx Formatting + targeted lint suppressions.
src/components/Samples/CustomSampleFirstCellRenderer.tsx Minor formatting + unused-var suppression.
src/components/Recent/PageRecent.tsx Formatting + targeted lint suppressions.
src/components/Recent/GraphTable.tsx Adds file-level disables + formatting.
src/components/Recent/GraphGridItem.tsx Formatting + unused-var suppression.
src/components/Recent/CustomNameCellRenderer.tsx Formatting-only quote normalization.
src/components/Recent/CustomLocationCellRenderer.tsx Formatting-only quote normalization.
src/components/Recent/CustomAuthorCellRenderer.tsx Formatting-only quote normalization.
src/components/MainContent.tsx Formatting-only reindent + quote normalization.
src/components/Learning/VideoCarouselItem.tsx Formatting + unused-var suppression.
src/components/Learning/PageLearning.tsx Formatting + require-import suppressions.
src/components/Learning/ModalItem.tsx Formatting-only reindent.
src/components/Learning/GuideGridItem.tsx Formatting + unused-var suppression.
src/components/Learning/Carousel.tsx Formatting + minor semicolon fixes.
src/components/LayoutContainer.tsx Adds hook-deps suppressions + minor log string change.
src/components/Common/Tooltip.tsx Formatting-only reindent.
src/components/Common/CardItem.tsx Formatting-only reindent.
src/components/Common/Arrow.tsx Formatting + prefer-const suppressions.
src/App.tsx Quote normalization + formatting-only.
playwright.config.js Adjusts local worker count.
package.json Updates lint scripts; adds TS ESLint + react-hooks deps.
package-lock.json Locks new lint/tooling dependencies.
.eslintrc Adds TS parser/plugins, hooks rules, and TS overrides.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Sidebar/CustomDropDown.tsx
Comment thread src/components/SettingsContext.tsx
Comment thread src/components/Samples/SamplesTable.tsx
Comment thread src/components/Recent/GraphTable.tsx
Comment thread src/components/Common/Arrow.tsx
Comment thread src/components/LayoutContainer.tsx
Comment thread src/functions/utility.ts
Comment thread src/components/Samples/SamplesTable.tsx
Comment thread src/components/Learning/VideoCarouselItem.tsx
Comment thread src/components/Samples/CustomSampleFirstCellRenderer.tsx
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.

3 participants