Microsoft/TypeScript

simply logic predicate code fix or suggestion

Open

#25.175 aberto em 23 de jun. de 2018

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)TypeScript (6.726 forks)batch import
Domain: LS: RefactoringsHelp WantedSuggestion

Métricas do repositório

Stars
 (48.455 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)

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)

Guia do colaborador