Skip to content

Airbase/gh-action-tscheck-action-shell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

no new @ts-nocheck

Checks if new @ts-nocheck is introduced in a PR or not.

  • It compares the pull request's current HEAD against the merge-base with the destination branch
  • It searches for the patterns // @ts-nocheck or /* @ts-nocheck in added/removed lines
  • Then, it separates out the additions and deletions and counts the instances in each of them
  • Finally, it would fail with exit 1 if the count in additions is more than count in deletions (which would mean the PR has introduced new @ts-nocheck instances)

How it works

The action searches for lines containing either:

  • // @ts-nocheck - line comment pattern
  • /* @ts-nocheck - block comment pattern

Lines can have other content before or after these patterns. The check ignores plain @ts-nocheck without comment markers.

The action fetches the base branch ref it needs before computing the merge-base, which avoids false positives when the PR branch is behind the base branch.

Tests

Run the regression tests locally with:

node tests/diff_test.ts

About

A GitHub action that runs git diff against the base branch and checks if new @ts-nochecks are added.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 59.1%
  • Shell 40.9%