Я использую eslint
в реакции.
У меня есть компонент:
interface IWrapperProps {
type: string;
}
const Wrapper: React.FC<IWrapperProps> = (props: IWrapperProps) => {
const { type} = props;
И я вызываю свой компонент с помощью:
< Wrapper type='test' />
....
Проблема в когда я пытаюсь позвонить с неправильным реквизитом:
< Wrapper type={1} /> // wrong props , type is string
....
Я выполняю eslitn через: eslint . --ext .ts --ext .tsx
Eslint не выдает ошибку для неправильного реквизита type
.. что я должен положить в мой файл конфигурации?
.eslintr c:
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"react",
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
}