microsoft / microsoft/TypeScript
make @ts-ignore available when using {/* @ts-ignore */}.
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
Search Terms
@ts-ignore annotation
Suggestion
Hi, I apologize if it is already discussed. However, I believe we need this feature for @ts-ignore.
Currently @ts-ignore only mutes the errors only using with // @ts-ignore.
I believe we also need to make @ts-ignore available when using {/* @ts-ignore */}.
I've already founded this issue. It's a similar issue but not the same and I think this is easier to implement.
I think this feature only need to change this code.
https://github.com/Microsoft/TypeScript/blob/master/src/compiler/program.ts#L2
Use Cases
I'd like to use this in the html structures in the TSX file.
Examples
This is implementation for amp-script. We have to use onclick instead of onClick and it's not supported for now.
const App = () => {
return (
<div>
...
{/* @ts-ignore */}
<button onclick={() => setCount(count + 1)}>Click me</button> // this line should be ignored
...
</div>
);
}
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. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
El issue apunta a src/compiler/program.ts; comienza allí y sigue cómo se reconocen los comentarios // @ts-ignore para TSX. Confirma el comportamiento solicitado con el ejemplo de TSX proporcionado y asegúrate de que el comportamiento existente de los comentarios no cambie.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100