Skip to content

Commit

Permalink
[Tests] boolean-prop-naming: add passing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 28, 2020
1 parent 9e4bbd0 commit 4661f1c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/lib/rules/boolean-prop-naming.js
Expand Up @@ -418,7 +418,7 @@ ruleTester.run('boolean-prop-naming', rule, {
}]
}],

invalid: [{
invalid: [].concat({
// createReactClass components with PropTypes
code: `
var Hello = createReactClass({
Expand Down Expand Up @@ -915,5 +915,16 @@ ruleTester.run('boolean-prop-naming', rule, {
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
}]
}, parsers.TS({
code: `
type Props = {
enabled: boolean
}
const HelloNew = (props: Props) => <div />;
`,
parser: parsers['@TYPESCRIPT_ESLINT'],
errors: [{
message: 'Prop name (enabled) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
}))
});

0 comments on commit 4661f1c

Please sign in to comment.