diff --git a/tests/lib/rules/no-typos.js b/tests/lib/rules/no-typos.js index f53745056c..00f4789c53 100644 --- a/tests/lib/rules/no-typos.js +++ b/tests/lib/rules/no-typos.js @@ -238,15 +238,6 @@ 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: ` @@ -763,5 +754,17 @@ ruleTester.run('no-typos', rule, { }, { message: 'Typo in declared prop type: objectof' }] + }, { + // PropTypes declared on a component that is detected through JSDoc comments and is + // declared AFTER the PropTypes only works when ESLint version is >= 4.7.0 + code: ` + MyComponent.PROPTYPES = {} + /** @extends React.Component */ + class MyComponent extends BaseComponent {} + `, + parserOptions: parserOptions, + errors: [{ + message: ERROR_MESSAGE + }] }] });