-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: react plugin allow .tsx extension
- Loading branch information
Showing
5 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# test-react-javascript | ||
|
||
This package is here just to provide a space for easily testing the react linting rules. | ||
|
||
It's not intended to be well maintained or do anything important, and will just be tweaked randomly to see how the lint config behaves. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "lint-test-react-typescript", | ||
"version": "0.0.0", | ||
"private": true, | ||
"license": "0BSD", | ||
"description": "a simple package with react to test the lint config with", | ||
"type": "module", | ||
"dependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.4.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
|
||
export function Test() { | ||
const [value, setValue] = React.useState(''); | ||
const [count, setCount] = React.useState(0); | ||
React.useEffect(() => { | ||
// linter should enforce `value` in hook dependencies | ||
console.log(value); | ||
}); | ||
return ( | ||
<div> | ||
<input onChange={(e) => setValue(e.target.value)} type="text" value={value} /> | ||
<button onClick={() => setCount(count + 1)} type="button"> | ||
type attribute should be required {count} | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters