Reputation: 1566
Is there a way to add a rule into eslintrc where by every .js or .jsx file in a src folder must contain proptypes and/or defaultprops, and if it doesnt, an error is thrown.
Upvotes: 6
Views: 3204
Reputation: 121
In your .eslintrc file you need to add the following lines:
plugins: [
'react',
],
rules: {
'react/prop-types': ['error'],
}
Upvotes: 6