-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug is missing in props validation #3090
Comments
Are you using the TypeScript eslint parser? |
yes {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"array-bracket-spacing": "warn",
"multiline-comment-style": "warn",
"no-console": "warn",
"comma-dangle": "off",
"no-var": "warn",
"no-duplicate-imports": "error",
"sort-imports": "warn"
}
} "devDependencies": {
"@types/chrome": "0.0.157",
"@types/nw.js": "^0.13.14",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-grid-layout": "^1.1.2",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"@vitejs/plugin-react-refresh": "^1.3.6",
"commander": "^8.1.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"nw": "^0.55.0",
"nw-builder": "^3.5.7",
"ts-essentials": "^8.1.0",
"vite": "^2.5.6"
} |
That all seems good. Can you make a repro repo? |
oki i think i understand what happening. interface Props {
age: number
}
const Hello: VoidFunctionComponent<Props> = function Hello(props) {
const { age } = props;
return <div>Hello {name}</div>;
}
const Hello2: FunctionComponent<Props> = function Hello(props) {
const { age } = props;
return <div>Hello {name}</div>;
} it seem is this a bug? or any rules options i can add to allow |
It may be an oversight. I think the plugin would need to be updated to handle it. cc @vedadeepta |
hi why this is not valid ? it should ok no!
![image](https://user-images.githubusercontent.com/24865815/135553248-9df26866-30a4-433c-bc75-1f50c9025149.png)
![image](https://user-images.githubusercontent.com/24865815/135553362-7c6e6474-5bc7-4020-8676-a223a610a00d.png)
here the demo from your example
The text was updated successfully, but these errors were encountered: