microsoft / microsoft/TypeScript

simply logic predicate code fix or suggestion

Open
#25,175 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: LS: Refactorings Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Search Terms

logic, predicate, quickfix

Suggestion

provide a code fix or refactor to simply logic predicate

Use Cases

simply some complexity logic predicate is hard and always get a break change,
hope have a code fix to simply that like the jetbrain idea

Examples


if (! a && !b || !a && !c) {
    // something
}

fix to:

if (!(a && (b || c))) {
    // something
}

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Start by reviewing the predicate example and the requested simplification, then determine the intended scope and behavior for a TypeScript code fix or refactor suggestion. Done means the behavior is clearly specified and covered by appropriate language-service tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.