Guest User

Untitled

a guest
Feb 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. diff --git a/tests/lib/rules/no-typos.js b/tests/lib/rules/no-typos.js
  2. index bd4bfc5..a1229cc 100644
  3. --- a/tests/lib/rules/no-typos.js
  4. +++ b/tests/lib/rules/no-typos.js
  5. @@ -847,5 +847,49 @@ ruleTester.run('no-typos', rule, {
  6. }, {
  7. message: 'Typo in prop type chain qualifier: isrequired'
  8. }]
  9. + }, {
  10. + code: `
  11. + import React from 'react';
  12. + import PropTypes from 'prop-types';
  13. + const Component = React.createClass({
  14. + propTypes: {
  15. + a: PropTypes.string.isrequired,
  16. + b: PropTypes.shape({
  17. + c: PropTypes.number
  18. + }).isrequired
  19. + }
  20. + });
  21. + `,
  22. + parser: 'babel-eslint',
  23. + parserOptions: parserOptions,
  24. + errors: [{
  25. + message: 'Typo in prop type chain qualifier: isrequired'
  26. + }, {
  27. + message: 'Typo in prop type chain qualifier: isrequired'
  28. + }]
  29. + }, {
  30. + code: `
  31. + import React from 'react';
  32. + import PropTypes from 'prop-types';
  33. + const Component = React.createClass({
  34. + childContextTypes: {
  35. + a: PropTypes.bools,
  36. + b: PropTypes.Array,
  37. + c: PropTypes.function,
  38. + d: PropTypes.objectof,
  39. + }
  40. + });
  41. + `,
  42. + parser: 'babel-eslint',
  43. + parserOptions: parserOptions,
  44. + errors: [{
  45. + message: 'Typo in declared prop type: bools'
  46. + }, {
  47. + message: 'Typo in declared prop type: Array'
  48. + }, {
  49. + message: 'Typo in declared prop type: function'
  50. + }, {
  51. + message: 'Typo in declared prop type: objectof'
  52. + }]
  53. }]
  54. });
Add Comment
Please, Sign In to add comment