@@ -1370,110 +1370,110 @@ ruleTester.run('no-typos', rule, {
1370
1370
message : 'Typo in declared prop type: objectof'
1371
1371
} ]
1372
1372
} ]
1373
- /*
1374
- // PropTypes declared on a component that is detected through JSDoc comments and is
1375
- // declared AFTER the PropTypes assignment
1376
- // Commented out since it only works with ESLint 5.
1377
- ,{
1378
- code: `
1379
- MyComponent.PROPTYPES = {}
1380
- \/** @extends React.Component *\/
1381
- class MyComponent extends BaseComponent {}
1382
- `,
1383
- parserOptions: parserOptions
1384
- },
1385
- */
1386
- /*
1387
- // createClass tests below fail, so they're commented out
1388
- // ---------
1389
- }, {
1390
- code: `
1391
- import React from 'react';
1392
- import PropTypes from 'prop-types';
1393
- const Component = React.createClass({
1394
- propTypes: {
1395
- a: PropTypes.string.isrequired,
1396
- b: PropTypes.shape({
1397
- c: PropTypes.number
1398
- }).isrequired
1399
- }
1400
- });
1401
- `,
1402
- parser: 'babel-eslint',
1403
- parserOptions: parserOptions,
1404
- errors: [{
1405
- message: 'Typo in prop type chain qualifier: isrequired'
1406
- }, {
1407
- message: 'Typo in prop type chain qualifier: isrequired'
1408
- }]
1409
- }, {
1410
- code: `
1411
- import React from 'react';
1412
- import PropTypes from 'prop-types';
1413
- const Component = React.createClass({
1414
- childContextTypes: {
1415
- a: PropTypes.bools,
1416
- b: PropTypes.Array,
1417
- c: PropTypes.function,
1418
- d: PropTypes.objectof,
1419
- }
1420
- });
1421
- `,
1422
- parser: 'babel-eslint',
1423
- parserOptions: parserOptions,
1424
- errors: [{
1425
- message: 'Typo in declared prop type: bools'
1426
- }, {
1427
- message: 'Typo in declared prop type: Array'
1428
- }, {
1429
- message: 'Typo in declared prop type: function'
1430
- }, {
1431
- message: 'Typo in declared prop type: objectof'
1432
- }]
1433
- }, {
1434
- code: `
1435
- import React from 'react';
1436
- import PropTypes from 'prop-types';
1437
- const Component = React.createClass({
1438
- propTypes: {
1439
- a: PropTypes.string.isrequired,
1440
- b: PropTypes.shape({
1441
- c: PropTypes.number
1442
- }).isrequired
1443
- }
1444
- });
1445
- `,
1446
- parserOptions: parserOptions,
1447
- errors: [{
1448
- message: 'Typo in prop type chain qualifier: isrequired'
1449
- }, {
1450
- message: 'Typo in prop type chain qualifier: isrequired'
1451
- }]
1452
- }, {
1453
- code: `
1454
- import React from 'react';
1455
- import PropTypes from 'prop-types';
1456
- const Component = React.createClass({
1457
- childContextTypes: {
1458
- a: PropTypes.bools,
1459
- b: PropTypes.Array,
1460
- c: PropTypes.function,
1461
- d: PropTypes.objectof,
1462
- }
1463
- });
1464
- `,
1465
- parserOptions: parserOptions,
1466
- errors: [{
1467
- message: 'Typo in declared prop type: bools'
1468
- }, {
1469
- message: 'Typo in declared prop type: Array'
1470
- }, {
1471
- message: 'Typo in declared prop type: function'
1472
- }, {
1473
- message: 'Typo in declared prop type: objectof'
1373
+ /*
1374
+ // PropTypes declared on a component that is detected through JSDoc comments and is
1375
+ // declared AFTER the PropTypes assignment
1376
+ // Commented out since it only works with ESLint 5.
1377
+ ,{
1378
+ code: `
1379
+ MyComponent.PROPTYPES = {}
1380
+ \/** @extends React.Component *\/
1381
+ class MyComponent extends BaseComponent {}
1382
+ `,
1383
+ parserOptions: parserOptions
1384
+ },
1385
+ */
1386
+ /*
1387
+ // createClass tests below fail, so they're commented out
1388
+ // ---------
1389
+ }, {
1390
+ code: `
1391
+ import React from 'react';
1392
+ import PropTypes from 'prop-types';
1393
+ const Component = React.createClass({
1394
+ propTypes: {
1395
+ a: PropTypes.string.isrequired,
1396
+ b: PropTypes.shape({
1397
+ c: PropTypes.number
1398
+ }).isrequired
1399
+ }
1400
+ });
1401
+ `,
1402
+ parser: 'babel-eslint',
1403
+ parserOptions: parserOptions,
1404
+ errors: [{
1405
+ message: 'Typo in prop type chain qualifier: isrequired'
1406
+ }, {
1407
+ message: 'Typo in prop type chain qualifier: isrequired'
1408
+ }]
1409
+ }, {
1410
+ code: `
1411
+ import React from 'react';
1412
+ import PropTypes from 'prop-types';
1413
+ const Component = React.createClass({
1414
+ childContextTypes: {
1415
+ a: PropTypes.bools,
1416
+ b: PropTypes.Array,
1417
+ c: PropTypes.function,
1418
+ d: PropTypes.objectof,
1419
+ }
1420
+ });
1421
+ `,
1422
+ parser: 'babel-eslint',
1423
+ parserOptions: parserOptions,
1424
+ errors: [{
1425
+ message: 'Typo in declared prop type: bools'
1426
+ }, {
1427
+ message: 'Typo in declared prop type: Array'
1428
+ }, {
1429
+ message: 'Typo in declared prop type: function'
1430
+ }, {
1431
+ message: 'Typo in declared prop type: objectof'
1432
+ }]
1433
+ }, {
1434
+ code: `
1435
+ import React from 'react';
1436
+ import PropTypes from 'prop-types';
1437
+ const Component = React.createClass({
1438
+ propTypes: {
1439
+ a: PropTypes.string.isrequired,
1440
+ b: PropTypes.shape({
1441
+ c: PropTypes.number
1442
+ }).isrequired
1443
+ }
1444
+ });
1445
+ `,
1446
+ parserOptions: parserOptions,
1447
+ errors: [{
1448
+ message: 'Typo in prop type chain qualifier: isrequired'
1449
+ }, {
1450
+ message: 'Typo in prop type chain qualifier: isrequired'
1451
+ }]
1452
+ }, {
1453
+ code: `
1454
+ import React from 'react';
1455
+ import PropTypes from 'prop-types';
1456
+ const Component = React.createClass({
1457
+ childContextTypes: {
1458
+ a: PropTypes.bools,
1459
+ b: PropTypes.Array,
1460
+ c: PropTypes.function,
1461
+ d: PropTypes.objectof,
1462
+ }
1463
+ });
1464
+ `,
1465
+ parserOptions: parserOptions,
1466
+ errors: [{
1467
+ message: 'Typo in declared prop type: bools'
1468
+ }, {
1469
+ message: 'Typo in declared prop type: Array'
1470
+ }, {
1471
+ message: 'Typo in declared prop type: function'
1472
+ }, {
1473
+ message: 'Typo in declared prop type: objectof'
1474
+ }]
1474
1475
}]
1475
- }]
1476
- // ---------
1477
- // createClass tests above fail, so they're commented out
1478
- */
1476
+ // ---------
1477
+ // createClass tests above fail, so they're commented out
1478
+ */
1479
1479
} ) ;
0 commit comments