Skip to content

Commit

Permalink
[Tests] failing test for jsx-eslint#2662
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 12, 2020
1 parent 03df672 commit f09ce08
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/lib/rules/forbid-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1460,5 +1460,30 @@ ruleTester.run('forbid-prop-types', rule, {
checkChildContextTypes: true
}],
errors: 1
}, {
code: [
'import { object, string } from "prop-types";',
'function C({ a, b }) { return [a, b]; }',
'C.propTypes = {',
' a: object,',
' b: string',
'};'
].join('\n'),
options: [{
forbid: ['object']
}],
errors: 1
}, {
code: [
'import { objectOf, any } from "prop-types";',
'function C({ a }) { return a; }',
'C.propTypes = {',
' a: objectOf(any)',
'};'
].join('\n'),
options: [{
forbid: ['any']
}],
errors: 1
}]
});

0 comments on commit f09ce08

Please sign in to comment.