mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Merge pull request #37907 from Jack-Works/feat/class-to-classname
feat: add a codefix to fix class to className in react & add spelling suggest for JSX attributes
This commit is contained in:
16
tests/cases/compiler/spellingSuggestionJSXAttribute.tsx
Normal file
16
tests/cases/compiler/spellingSuggestionJSXAttribute.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
// @jsx: react
|
||||
/// <reference path="/.lib/react16.d.ts" />
|
||||
import * as React from "react";
|
||||
|
||||
function MyComp2(props: { className?: string, htmlFor?: string }) {
|
||||
return null!;
|
||||
}
|
||||
class MyComp extends React.Component<{ className?: string, htmlFor?: string }> { }
|
||||
<a class="" />;
|
||||
<a for="" />; // should have no fix
|
||||
<label for="" />;
|
||||
<label for="" class="" />;
|
||||
<MyComp class="" />;
|
||||
<MyComp2 class="" />;
|
||||
<MyComp for="" />;
|
||||
<MyComp2 for="" />;
|
||||
Reference in New Issue
Block a user