@@ -506,8 +506,7 @@ module.exports = {
506
506
507
507
// Prevent usage of `javascript:` URLs
508
508
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
509
- // TODO: enable, semver-major
510
- 'react/jsx-no-script-url' : [ 'off' , [
509
+ 'react/jsx-no-script-url' : [ 'error' , [
511
510
{
512
511
name : 'Link' ,
513
512
props : [ 'to' ] ,
@@ -516,8 +515,7 @@ module.exports = {
516
515
517
516
// Disallow unnecessary fragments
518
517
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
519
- // TODO: enable, semver-major
520
- 'react/jsx-no-useless-fragment' : 'off' ,
518
+ 'react/jsx-no-useless-fragment' : 'error' ,
521
519
522
520
// Prevent adjacent inline elements not separated by whitespace
523
521
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
@@ -526,9 +524,8 @@ module.exports = {
526
524
527
525
// Enforce a specific function type for function components
528
526
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
529
- // TODO: enable! semver-minor, but do it in a major to be safe
530
527
// TODO: investigate if setting namedComponents to expression vs declaration is problematic
531
- 'react/function-component-definition' : [ 'off ' , {
528
+ 'react/function-component-definition' : [ 'error ' , {
532
529
namedComponents : 'function-expression' ,
533
530
unnamedComponents : 'function-expression' ,
534
531
} ] ,
@@ -539,23 +536,31 @@ module.exports = {
539
536
540
537
// Prevent react contexts from taking non-stable values
541
538
// https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md
542
- // TODO: enable, semver-minor
543
- 'react/jsx-no-constructed-context-values' : 'off' ,
539
+ 'react/jsx-no-constructed-context-values' : 'error' ,
544
540
545
541
// Prevent creating unstable components inside components
546
542
// https://github.com/yannickcr/eslint-plugin-react/blob/c2a790a3472eea0f6de984bdc3ee2a62197417fb/docs/rules/no-unstable-nested-components.md
547
- // TODO: enable, semver-major
548
- 'react/no-unstable-nested-components' : 'off' ,
543
+ 'react/no-unstable-nested-components' : 'error' ,
549
544
550
545
// Enforce that namespaces are not used in React elements
551
546
// https://github.com/yannickcr/eslint-plugin-react/blob/8785c169c25b09b33c95655bf508cf46263bc53f/docs/rules/no-namespace.md
552
- // TODO: enable, semver-minor
553
- 'react/no-namespace' : 'off' ,
547
+ 'react/no-namespace' : 'error' ,
554
548
555
549
// Prefer exact proptype definitions
556
550
// https://github.com/yannickcr/eslint-plugin-react/blob/8785c169c25b09b33c95655bf508cf46263bc53f/docs/rules/prefer-exact-props.md
557
- // TODO: enable, semver-major, just in case
558
- 'react/prefer-exact-props' : 'off' ,
551
+ 'react/prefer-exact-props' : 'error' ,
552
+
553
+ // Lifecycle methods should be methods on the prototype, not class fields
554
+ // https://github.com/yannickcr/eslint-plugin-react/blob/21e01b61af7a38fc86d94f27eb66cda8054582ed/docs/rules/no-arrow-function-lifecycle.md
555
+ 'react/no-arrow-function-lifecycle' : 'error' ,
556
+
557
+ // Prevent usage of invalid attributes
558
+ // https://github.com/yannickcr/eslint-plugin-react/blob/21e01b61af7a38fc86d94f27eb66cda8054582ed/docs/rules/no-invalid-html-attribute.md
559
+ 'react/no-invalid-html-attribute' : 'error' ,
560
+
561
+ // Prevent declaring unused methods of component class
562
+ // https://github.com/yannickcr/eslint-plugin-react/blob/21e01b61af7a38fc86d94f27eb66cda8054582ed/docs/rules/no-unused-class-component-methods.md
563
+ 'react/no-unused-class-component-methods' : 'error' ,
559
564
} ,
560
565
561
566
settings : {
0 commit comments