Skip to content

Commit fa890cb

Browse files
author
Joachim Seminck
committed
Tests and explaining the case that is currently not supported.
1 parent 1301fe9 commit fa890cb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/lib/rules/no-typos.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ ruleTester.run('no-typos', rule, {
240240
'}'
241241
].join('\n'),
242242
parserOptions: parserOptions
243+
}, {
244+
// PropTypes declared on a component that is detected through JSDoc comments and is
245+
// declared AFTER the PropTypes assignment does not work.
246+
code: `
247+
MyComponent.PROPTYPES = {}
248+
/** @extends React.Component */
249+
class MyComponent extends BaseComponent {}
250+
`,
251+
parserOptions: parserOptions
243252
}, {
244253
// https://github.com/yannickcr/eslint-plugin-react/issues/1353
245254
code: `
@@ -435,6 +444,21 @@ ruleTester.run('no-typos', rule, {
435444
].join('\n'),
436445
parserOptions: parserOptions,
437446
errors: [{message: ERROR_MESSAGE}]
447+
}, {
448+
code: [
449+
'Component.defaultprops = {}',
450+
'class Component extends React.Component {}'
451+
].join('\n'),
452+
parserOptions: parserOptions,
453+
errors: [{message: ERROR_MESSAGE}]
454+
}, {
455+
code: `
456+
/** @extends React.Component */
457+
class MyComponent extends BaseComponent {}
458+
MyComponent.PROPTYPES = {}
459+
`,
460+
parserOptions: parserOptions,
461+
errors: [{message: ERROR_MESSAGE}]
438462
}, {
439463
code: [
440464
'class Hello extends React.Component {',

0 commit comments

Comments
 (0)