Repository navigation
TypeScript linter: a warning for logic that is not in a primitive (CUP-I008) - #10
Open
JoshuaWink wants to merge 3 commits into
Open
JoshuaWink wants to merge 3 commits into
JoshuaWink wants to merge 3 commits into
Conversation
A project that uses codeupipe writes its logic as Filters, Predicates, Taps, Hooks and Pipelines. Logic in a plain function or a plain class works as well, so nothing showed the mistake. The linter now reports a function, a class or the code at the top of a file that has logic (if, ? :, switch, a loop, try) and is not a primitive. - It is a warning: it is in the report, it is counted apart, and it does not fail the run. --strict makes a warning fail the run. - A comment with a reason allows plain code: // cup: allow-plain <why>. - Test files are not checked. The code of the framework itself is marked. The TypeScript linter and the TypeScript compiler of this repository have 40 warnings: their helpers are plain functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cup: allow-... comment that allowed no finding is a warning. It stays when the code that it was for is gone or has moved, or when its kind has a spelling error. Rules that are switched off are dropped last, so that a comment for such a rule is not reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CUP-I008 is logic that is not in a primitive. CUP-I009 is a comment that allows nothing. Both are warnings: the linter now has warnings, and --strict makes one fail the run. Rules that are switched off are dropped last, so that a comment for such a rule is not reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is added
A project that uses codeupipe writes its logic as Filters, Predicates, Taps, Hooks and Pipelines. Logic in a plain function or a plain class works as well, so nothing showed the mistake. The TypeScript linter now reports it.
if,? :,switch,for,while,do,try.map,filter,forEach), and&&/||.It is a warning
A warning is in the report and is counted apart:
No findings. 3 warnings.It does not make the exit code 1. With--strict, a warning fails the run as a finding does.For logic that must be plain code, a comment says why:
// cup: allow-plain <reason>.What it finds in this repository
The code of the framework itself (
Payload, the shape check ofPipeline,labelOf) is marked withallow-plain. The TypeScript linter and the TypeScript compiler have 40 warnings, because their helpers are plain functions. This pull request does not change them.Not in this pull request
The Python linter does not have this rule.
🤖 Generated with Claude Code