microsoft / microsoft/TypeScript
Indicate in the editor that a type is explicitly `any`
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 117
Description
🔍 Search Terms
any marker editor
✅ Viability Checklist
- 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. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Types that are explicitly set to any are sometimes hard to distinguish from actually typed variables in the editor. You might be adopting types while still having a lot of any around and then it would be helpful to call any out more explicitly in the editor.
📃 Motivating Example
I am now using the extension https://marketplace.visualstudio.com/items?itemName=danvk.any-xray which does this:
💻 Use Cases
- What do you want to use this for?
Seeing explicit any types easily so that I can work on adding types.
- What shortcomings exist with current approaches?
I can disable explicit any by producing errors but that is very aggressive.
- What workarounds are you using in the meantime?
Hovering over the type.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
L’issue décrit une indication dans l’éditeur pour les types any déclarés explicitement et indique l’extension any-xray comme référence. Commencez par retracer comment TypeScript expose les informations de type aux éditeurs et examiner les tests associés de l’éditeur ou du language-service ; le travail est considéré comme terminé lorsque l’indication prévue est implémentée sans modifier la sortie à l’exécution et qu’elle est couverte par des tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- developer-experience, tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100