Skip to content

Commit

Permalink
Tests and explaining the case that is currently not supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Seminck committed Aug 15, 2017
1 parent 1301fe9 commit fa890cb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ ruleTester.run('no-typos', rule, {
'}'
].join('\n'),
parserOptions: parserOptions
}, {
// PropTypes declared on a component that is detected through JSDoc comments and is
// declared AFTER the PropTypes assignment does not work.
code: `
MyComponent.PROPTYPES = {}
/** @extends React.Component */
class MyComponent extends BaseComponent {}
`,
parserOptions: parserOptions
}, {
// https://github.com/yannickcr/eslint-plugin-react/issues/1353
code: `
Expand Down Expand Up @@ -435,6 +444,21 @@ ruleTester.run('no-typos', rule, {
].join('\n'),
parserOptions: parserOptions,
errors: [{message: ERROR_MESSAGE}]
}, {
code: [
'Component.defaultprops = {}',
'class Component extends React.Component {}'
].join('\n'),
parserOptions: parserOptions,
errors: [{message: ERROR_MESSAGE}]
}, {
code: `
/** @extends React.Component */
class MyComponent extends BaseComponent {}
MyComponent.PROPTYPES = {}
`,
parserOptions: parserOptions,
errors: [{message: ERROR_MESSAGE}]
}, {
code: [
'class Hello extends React.Component {',
Expand Down

0 comments on commit fa890cb

Please sign in to comment.