Skip to content

SCAL-238049 add pre-commit type/lint gate, fix tsc exit-code bug - #682

Merged
jitendra-bhati-ts merged 3 commits into
mainfrom
SCAL-238049-precommit-typecheck
Sep 23, 2026
Merged

jitendra-bhati-ts merged 3 commits into
mainfrom
SCAL-238049-precommit-typecheck

Conversation

@jitendra-bhati-ts

Copy link
Copy Markdown
Collaborator

Add husky + lint-staged: pre-commit lints staged files and type-checks the full project. Lint-staged config lives in .lintstagedrc.json to match the convention.

Fix tsc script exit code: ';' between the two compiles reported only the second command's status, so a failing ESM compile could still pass CI. Changed to '&&'.

Add tsc:check (--noEmit) so the hook checks types without writing to lib/ and cjs/.

Fix comment-length lint warnings across affected files (line wrapping only, no logic changes).

Set eslint-plugin-react version to 'detect' to silence a config warning on every lint run.

Add husky + lint-staged: pre-commit lints staged files and type-checks
the full project. Lint-staged config lives in .lintstagedrc.json to
match the convention used in spotter-code's pre-commit setup.

Fix tsc script exit code: ';' between the two compiles reported only
the second command's status, so a failing ESM compile could still
pass CI. Changed to '&&'.

Add tsc:check (--noEmit) so the hook checks types without writing to
lib/ and cjs/.

Fix comment-length lint warnings across affected files (line wrapping
only, no logic changes).

Set eslint-plugin-react version to 'detect' to silence a config
warning on every lint run.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces Husky and lint-staged to run linting and type checks on pre-commit, updates ESLint configurations, and reformats comment wrapping across multiple files. The review feedback suggests adding a shebang line to the pre-commit hook script for better portability and offers suggestions to improve the readability of several wrapped comments.

Comment thread .husky/pre-commit
Comment thread src/embed/ts-embed.ts
Comment thread src/utils/authService/tokenizedAuthService.spec.ts
Comment thread src/utils/custom-actions.spec.ts
Comment thread src/utils/processData.spec.ts
@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@682

commit: cc466a2

Comment thread package.json
yinstardev
yinstardev previously approved these changes Sep 23, 2026

@shivam-kumar-ts shivam-kumar-ts 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.

LGTM

Drop .lintstagedrc.json and move its one rule under a 'lint-staged'
key in package.json instead, so the pre-commit setup only touches
eslint.config.mjs and .husky/pre-commit rather than a third file.
No behavior change.

@shivam-kumar-ts shivam-kumar-ts 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.

LGTM

Add #!/bin/sh at the top of .husky/pre-commit and mark it executable,
so the script runs with the correct interpreter regardless of how it
is invoked.
@jitendra-bhati-ts
jitendra-bhati-ts merged commit 8236f9e into main Sep 23, 2026
10 checks passed
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.

4 participants