From d11d55dfe162d54b61930fea83e7758a3e6a2c2e Mon Sep 17 00:00:00 2001 From: Vlad Esin Date: Wed, 8 Apr 2020 17:54:16 +0500 Subject: [PATCH 1/5] Add support --fix-type 1) Add the type field in rule's meta 2) Fix the fixable field --- lib/rules/boolean-prop-naming.js | 2 +- lib/rules/button-has-type.js | 1 + lib/rules/default-props-match-prop-types.js | 1 + lib/rules/destructuring-assignment.js | 1 + lib/rules/display-name.js | 1 + lib/rules/forbid-component-props.js | 1 + lib/rules/forbid-dom-props.js | 1 + lib/rules/forbid-elements.js | 1 + lib/rules/forbid-foreign-prop-types.js | 1 + lib/rules/forbid-prop-types.js | 1 + lib/rules/function-component-definition.js | 1 + lib/rules/jsx-boolean-value.js | 1 + lib/rules/jsx-child-element-spacing.js | 3 ++- lib/rules/jsx-closing-bracket-location.js | 3 ++- lib/rules/jsx-closing-tag-location.js | 1 + lib/rules/jsx-curly-brace-presence.js | 1 + lib/rules/jsx-curly-newline.js | 3 --- lib/rules/jsx-curly-spacing.js | 3 ++- lib/rules/jsx-equals-spacing.js | 3 ++- lib/rules/jsx-filename-extension.js | 1 + lib/rules/jsx-first-prop-new-line.js | 3 ++- lib/rules/jsx-fragments.js | 1 + lib/rules/jsx-handler-names.js | 1 + lib/rules/jsx-indent-props.js | 3 ++- lib/rules/jsx-indent.js | 1 + lib/rules/jsx-key.js | 1 + lib/rules/jsx-max-depth.js | 1 + lib/rules/jsx-max-props-per-line.js | 3 ++- lib/rules/jsx-no-bind.js | 1 + lib/rules/jsx-no-comment-textnodes.js | 1 + lib/rules/jsx-no-duplicate-props.js | 1 + lib/rules/jsx-no-literals.js | 1 + lib/rules/jsx-no-script-url.js | 1 + lib/rules/jsx-no-target-blank.js | 1 + lib/rules/jsx-no-undef.js | 1 + lib/rules/jsx-one-expression-per-line.js | 1 + lib/rules/jsx-pascal-case.js | 1 + lib/rules/jsx-props-no-multi-spaces.js | 3 ++- lib/rules/jsx-props-no-spreading.js | 1 + lib/rules/jsx-sort-default-props.js | 1 + lib/rules/jsx-sort-props.js | 1 + lib/rules/jsx-space-before-closing.js | 3 ++- lib/rules/jsx-tag-spacing.js | 1 + lib/rules/jsx-uses-react.js | 1 + lib/rules/jsx-uses-vars.js | 1 + lib/rules/jsx-wrap-multilines.js | 1 + lib/rules/no-access-state-in-setstate.js | 1 + lib/rules/no-adjacent-inline-elements.js | 1 + lib/rules/no-array-index-key.js | 3 ++- lib/rules/no-children-prop.js | 1 + lib/rules/no-danger-with-children.js | 3 ++- lib/rules/no-danger.js | 1 + lib/rules/no-deprecated.js | 1 + lib/rules/no-direct-mutation-state.js | 1 + lib/rules/no-find-dom-node.js | 1 + lib/rules/no-is-mounted.js | 1 + lib/rules/no-multi-comp.js | 1 + lib/rules/no-redundant-should-component-update.js | 1 + lib/rules/no-render-return-value.js | 1 + lib/rules/no-set-state.js | 1 + lib/rules/no-string-refs.js | 1 + lib/rules/no-this-in-sfc.js | 1 + lib/rules/no-typos.js | 1 + lib/rules/no-unescaped-entities.js | 1 + lib/rules/no-unknown-property.js | 1 + lib/rules/no-unsafe.js | 1 + lib/rules/no-unused-prop-types.js | 1 + lib/rules/no-unused-state.js | 1 + lib/rules/prefer-es6-class.js | 1 + lib/rules/prefer-read-only-props.js | 1 + lib/rules/prefer-stateless-function.js | 1 + lib/rules/prop-types.js | 1 + lib/rules/react-in-jsx-scope.js | 1 + lib/rules/require-default-props.js | 1 + lib/rules/require-optimization.js | 1 + lib/rules/require-render-return.js | 1 + lib/rules/self-closing-comp.js | 1 + lib/rules/sort-comp.js | 1 + lib/rules/sort-prop-types.js | 1 + lib/rules/state-in-constructor.js | 1 + lib/rules/static-property-placement.js | 3 ++- lib/rules/style-prop-object.js | 3 ++- lib/rules/void-dom-elements-no-children.js | 1 + lib/util/makeNoMethodSetStateRule.js | 1 + 84 files changed, 96 insertions(+), 17 deletions(-) diff --git a/lib/rules/boolean-prop-naming.js b/lib/rules/boolean-prop-naming.js index e319df8d88..97bffe0d1f 100644 --- a/lib/rules/boolean-prop-naming.js +++ b/lib/rules/boolean-prop-naming.js @@ -16,13 +16,13 @@ const propWrapperUtil = require('../util/propWrapper'); module.exports = { meta: { + type: 'suggestion', docs: { category: 'Stylistic Issues', description: 'Enforces consistent naming for boolean props', recommended: false, url: docsUrl('boolean-prop-naming') }, - schema: [{ additionalProperties: false, properties: { diff --git a/lib/rules/button-has-type.js b/lib/rules/button-has-type.js index a7d4694b77..d21a72dfa2 100644 --- a/lib/rules/button-has-type.js +++ b/lib/rules/button-has-type.js @@ -36,6 +36,7 @@ const optionDefaults = { module.exports = { meta: { + type: 'problem', docs: { description: 'Forbid "button" element without an explicit "type" attribute', category: 'Possible Errors', diff --git a/lib/rules/default-props-match-prop-types.js b/lib/rules/default-props-match-prop-types.js index 988949bc42..e938185ab1 100644 --- a/lib/rules/default-props-match-prop-types.js +++ b/lib/rules/default-props-match-prop-types.js @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce all defaultProps are defined and not "required" in propTypes.', category: 'Best Practices', diff --git a/lib/rules/destructuring-assignment.js b/lib/rules/destructuring-assignment.js index 02999116a2..1a45fcd5ea 100644 --- a/lib/rules/destructuring-assignment.js +++ b/lib/rules/destructuring-assignment.js @@ -12,6 +12,7 @@ const DEFAULT_OPTION = 'always'; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce consistent usage of destructuring assignment of props, state, and context', category: 'Stylistic Issues', diff --git a/lib/rules/display-name.js b/lib/rules/display-name.js index 0e0b4e7737..78a5d3ecd4 100644 --- a/lib/rules/display-name.js +++ b/lib/rules/display-name.js @@ -16,6 +16,7 @@ const propsUtil = require('../util/props'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent missing displayName in a React component definition', category: 'Best Practices', diff --git a/lib/rules/forbid-component-props.js b/lib/rules/forbid-component-props.js index 6c11687315..f2b0828e40 100644 --- a/lib/rules/forbid-component-props.js +++ b/lib/rules/forbid-component-props.js @@ -19,6 +19,7 @@ const DEFAULTS = ['className', 'style']; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid certain props on components', category: 'Best Practices', diff --git a/lib/rules/forbid-dom-props.js b/lib/rules/forbid-dom-props.js index 08853a412d..c88cf8e9fb 100644 --- a/lib/rules/forbid-dom-props.js +++ b/lib/rules/forbid-dom-props.js @@ -19,6 +19,7 @@ const DEFAULTS = []; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid certain props on DOM Nodes', category: 'Best Practices', diff --git a/lib/rules/forbid-elements.js b/lib/rules/forbid-elements.js index bb005172f9..977f32ea79 100644 --- a/lib/rules/forbid-elements.js +++ b/lib/rules/forbid-elements.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid certain elements', category: 'Best Practices', diff --git a/lib/rules/forbid-foreign-prop-types.js b/lib/rules/forbid-foreign-prop-types.js index ad23d508ef..1eea35cda6 100644 --- a/lib/rules/forbid-foreign-prop-types.js +++ b/lib/rules/forbid-foreign-prop-types.js @@ -10,6 +10,7 @@ const ast = require('../util/ast'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid using another component\'s propTypes', category: 'Best Practices', diff --git a/lib/rules/forbid-prop-types.js b/lib/rules/forbid-prop-types.js index 04b61bf734..17752d904f 100644 --- a/lib/rules/forbid-prop-types.js +++ b/lib/rules/forbid-prop-types.js @@ -22,6 +22,7 @@ const DEFAULTS = ['any', 'array', 'object']; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid certain propTypes', category: 'Best Practices', diff --git a/lib/rules/function-component-definition.js b/lib/rules/function-component-definition.js index e582dc48f6..12794597c4 100644 --- a/lib/rules/function-component-definition.js +++ b/lib/rules/function-component-definition.js @@ -98,6 +98,7 @@ function isFunctionExpressionWithName(node) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Standardize the way function component get defined', category: 'Stylistic issues', diff --git a/lib/rules/jsx-boolean-value.js b/lib/rules/jsx-boolean-value.js index 50768b5875..65ed283479 100644 --- a/lib/rules/jsx-boolean-value.js +++ b/lib/rules/jsx-boolean-value.js @@ -48,6 +48,7 @@ function isNever(configuration, exceptions, propName) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce boolean attributes notation in JSX', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-child-element-spacing.js b/lib/rules/jsx-child-element-spacing.js index 6c78257626..5d1fe0d3f4 100644 --- a/lib/rules/jsx-child-element-spacing.js +++ b/lib/rules/jsx-child-element-spacing.js @@ -39,13 +39,14 @@ const INLINE_ELEMENTS = new Set([ module.exports = { meta: { + type: 'layout', docs: { description: 'Ensures inline tags are not rendered without spaces between them', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-child-element-spacing') }, - fixable: null, + // fixable: null, schema: [ { type: 'object', diff --git a/lib/rules/jsx-closing-bracket-location.js b/lib/rules/jsx-closing-bracket-location.js index e0863f9e81..f6de4c260a 100644 --- a/lib/rules/jsx-closing-bracket-location.js +++ b/lib/rules/jsx-closing-bracket-location.js @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'layout', docs: { description: 'Validate closing bracket location in JSX', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-closing-bracket-location') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ oneOf: [ diff --git a/lib/rules/jsx-closing-tag-location.js b/lib/rules/jsx-closing-tag-location.js index d4bf10e1a7..93b5b1a887 100644 --- a/lib/rules/jsx-closing-tag-location.js +++ b/lib/rules/jsx-closing-tag-location.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'layout', docs: { description: 'Validate closing tag location for multiline JSX', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-curly-brace-presence.js b/lib/rules/jsx-curly-brace-presence.js index deeda0bc97..31f2d39cec 100755 --- a/lib/rules/jsx-curly-brace-presence.js +++ b/lib/rules/jsx-curly-brace-presence.js @@ -32,6 +32,7 @@ const DEFAULT_CONFIG = {props: OPTION_NEVER, children: OPTION_NEVER}; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Disallow unnecessary JSX expressions when literals alone are sufficient ' + diff --git a/lib/rules/jsx-curly-newline.js b/lib/rules/jsx-curly-newline.js index 62823e27cb..8681a65b72 100644 --- a/lib/rules/jsx-curly-newline.js +++ b/lib/rules/jsx-curly-newline.js @@ -36,16 +36,13 @@ function getNormalizedOption(context) { module.exports = { meta: { type: 'layout', - docs: { description: 'Enforce consistent line breaks inside jsx curly', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-curly-newline') }, - fixable: 'whitespace', - schema: [ { oneOf: [ diff --git a/lib/rules/jsx-curly-spacing.js b/lib/rules/jsx-curly-spacing.js index a53f24a740..8b148f5255 100644 --- a/lib/rules/jsx-curly-spacing.js +++ b/lib/rules/jsx-curly-spacing.js @@ -26,13 +26,14 @@ const SPACING_VALUES = [SPACING.always, SPACING.never]; module.exports = { meta: { + type: 'layout', docs: { description: 'Enforce or disallow spaces inside of curly braces in JSX attributes', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-curly-spacing') }, - fixable: 'code', + fixable: 'whitespace', schema: { definitions: { diff --git a/lib/rules/jsx-equals-spacing.js b/lib/rules/jsx-equals-spacing.js index 27f0bec9a5..689a9c2db8 100644 --- a/lib/rules/jsx-equals-spacing.js +++ b/lib/rules/jsx-equals-spacing.js @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'layout', docs: { description: 'Disallow or enforce spaces around equal signs in JSX attributes', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-equals-spacing') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ enum: ['always', 'never'] diff --git a/lib/rules/jsx-filename-extension.js b/lib/rules/jsx-filename-extension.js index 3d23cb4dc6..5943b4fb0d 100644 --- a/lib/rules/jsx-filename-extension.js +++ b/lib/rules/jsx-filename-extension.js @@ -22,6 +22,7 @@ const DEFAULTS = { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Restrict file extensions that may contain JSX', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-first-prop-new-line.js b/lib/rules/jsx-first-prop-new-line.js index 30b4a574be..1e88938681 100644 --- a/lib/rules/jsx-first-prop-new-line.js +++ b/lib/rules/jsx-first-prop-new-line.js @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'layout', docs: { description: 'Ensure proper position of the first property in JSX', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-first-prop-new-line') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ enum: ['always', 'never', 'multiline', 'multiline-multiprop'] diff --git a/lib/rules/jsx-fragments.js b/lib/rules/jsx-fragments.js index d2ec3ab3c7..777fa2d078 100644 --- a/lib/rules/jsx-fragments.js +++ b/lib/rules/jsx-fragments.js @@ -21,6 +21,7 @@ function replaceNode(source, node, text) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce shorthand or standard form for React fragments', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-handler-names.js b/lib/rules/jsx-handler-names.js index 7c2b34a4c1..68c90e6f50 100644 --- a/lib/rules/jsx-handler-names.js +++ b/lib/rules/jsx-handler-names.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce event handler naming conventions in JSX', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-indent-props.js b/lib/rules/jsx-indent-props.js index c2bbe511dd..6373b28a05 100644 --- a/lib/rules/jsx-indent-props.js +++ b/lib/rules/jsx-indent-props.js @@ -38,13 +38,14 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'layout', docs: { description: 'Validate props indentation in JSX', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-indent-props') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ oneOf: [{ diff --git a/lib/rules/jsx-indent.js b/lib/rules/jsx-indent.js index a7c4de1a37..8e7d0ad375 100644 --- a/lib/rules/jsx-indent.js +++ b/lib/rules/jsx-indent.js @@ -40,6 +40,7 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'layout', docs: { description: 'Validate JSX indentation', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-key.js b/lib/rules/jsx-key.js index 8daeebf10e..c5d2c1f6eb 100644 --- a/lib/rules/jsx-key.js +++ b/lib/rules/jsx-key.js @@ -20,6 +20,7 @@ const defaultOptions = { module.exports = { meta: { + type: 'problem', docs: { description: 'Report missing `key` props in iterators/collection literals', category: 'Possible Errors', diff --git a/lib/rules/jsx-max-depth.js b/lib/rules/jsx-max-depth.js index 1e0edd5369..21e3947565 100644 --- a/lib/rules/jsx-max-depth.js +++ b/lib/rules/jsx-max-depth.js @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'suggestion', docs: { description: 'Validate JSX maximum depth', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-max-props-per-line.js b/lib/rules/jsx-max-props-per-line.js index 387a9ff0c8..5f0ea570a4 100644 --- a/lib/rules/jsx-max-props-per-line.js +++ b/lib/rules/jsx-max-props-per-line.js @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'layout', docs: { description: 'Limit maximum of props on a single line in JSX', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-max-props-per-line') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ type: 'object', properties: { diff --git a/lib/rules/jsx-no-bind.js b/lib/rules/jsx-no-bind.js index 612f492cea..549b47dae5 100644 --- a/lib/rules/jsx-no-bind.js +++ b/lib/rules/jsx-no-bind.js @@ -25,6 +25,7 @@ const violationMessageStore = { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevents usage of Function.prototype.bind and arrow functions in React component props', category: 'Best Practices', diff --git a/lib/rules/jsx-no-comment-textnodes.js b/lib/rules/jsx-no-comment-textnodes.js index 39e56bef38..888d0077d1 100644 --- a/lib/rules/jsx-no-comment-textnodes.js +++ b/lib/rules/jsx-no-comment-textnodes.js @@ -31,6 +31,7 @@ function checkText(node, context) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Comments inside children section of tag should be placed inside braces', category: 'Possible Errors', diff --git a/lib/rules/jsx-no-duplicate-props.js b/lib/rules/jsx-no-duplicate-props.js index 7d9e00689e..88c02af495 100644 --- a/lib/rules/jsx-no-duplicate-props.js +++ b/lib/rules/jsx-no-duplicate-props.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Enforce no duplicate props', category: 'Possible Errors', diff --git a/lib/rules/jsx-no-literals.js b/lib/rules/jsx-no-literals.js index e4b1ab8eba..ed434ea761 100644 --- a/lib/rules/jsx-no-literals.js +++ b/lib/rules/jsx-no-literals.js @@ -18,6 +18,7 @@ function trimIfString(val) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent using string literals in React component definition', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-no-script-url.js b/lib/rules/jsx-no-script-url.js index 63cf7dd023..2c0b3543e2 100644 --- a/lib/rules/jsx-no-script-url.js +++ b/lib/rules/jsx-no-script-url.js @@ -44,6 +44,7 @@ function shouldVerifyProp(node, config) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid `javascript:` URLs', category: 'Best Practices', diff --git a/lib/rules/jsx-no-target-blank.js b/lib/rules/jsx-no-target-blank.js index 41b3de4ef9..b9ce6eea99 100644 --- a/lib/rules/jsx-no-target-blank.js +++ b/lib/rules/jsx-no-target-blank.js @@ -61,6 +61,7 @@ function hasSecureRel(element, allowReferrer) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Forbid target="_blank" attribute without rel="noopener noreferrer"', category: 'Best Practices', diff --git a/lib/rules/jsx-no-undef.js b/lib/rules/jsx-no-undef.js index a887e48bb1..34bf7dde3b 100644 --- a/lib/rules/jsx-no-undef.js +++ b/lib/rules/jsx-no-undef.js @@ -14,6 +14,7 @@ const jsxUtil = require('../util/jsx'); module.exports = { meta: { + type: 'problem', docs: { description: 'Disallow undeclared variables in JSX', category: 'Possible Errors', diff --git a/lib/rules/jsx-one-expression-per-line.js b/lib/rules/jsx-one-expression-per-line.js index 093969d208..d95c849f4b 100644 --- a/lib/rules/jsx-one-expression-per-line.js +++ b/lib/rules/jsx-one-expression-per-line.js @@ -18,6 +18,7 @@ const optionDefaults = { module.exports = { meta: { + type: 'layout', docs: { description: 'Limit to one expression per line in JSX', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-pascal-case.js b/lib/rules/jsx-pascal-case.js index e6e1339cc2..203c5638cc 100644 --- a/lib/rules/jsx-pascal-case.js +++ b/lib/rules/jsx-pascal-case.js @@ -26,6 +26,7 @@ const ALL_CAPS_TAG_REGEX = XRegExp('^[\\p{Lu}0-9]+([\\p{Lu}0-9_]*[\\p{Lu}0-9]+)? module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce PascalCase for user-defined JSX components', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-props-no-multi-spaces.js b/lib/rules/jsx-props-no-multi-spaces.js index a44494e27c..9c270dcf93 100644 --- a/lib/rules/jsx-props-no-multi-spaces.js +++ b/lib/rules/jsx-props-no-multi-spaces.js @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'layout', docs: { description: 'Disallow multiple spaces between inline JSX props', category: 'Stylistic Issues', recommended: false, url: docsUrl('jsx-props-no-multi-spaces') }, - fixable: 'code', + fixable: 'whitespace', schema: [] }, diff --git a/lib/rules/jsx-props-no-spreading.js b/lib/rules/jsx-props-no-spreading.js index 76e5b0b2be..cdaa9f89e9 100644 --- a/lib/rules/jsx-props-no-spreading.js +++ b/lib/rules/jsx-props-no-spreading.js @@ -25,6 +25,7 @@ const DEFAULTS = { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent JSX prop spreading', category: 'Best Practices', diff --git a/lib/rules/jsx-sort-default-props.js b/lib/rules/jsx-sort-default-props.js index 88f230ae6d..7cd82d7c92 100644 --- a/lib/rules/jsx-sort-default-props.js +++ b/lib/rules/jsx-sort-default-props.js @@ -16,6 +16,7 @@ const propWrapperUtil = require('../util/propWrapper'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce default props alphabetical sorting', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-sort-props.js b/lib/rules/jsx-sort-props.js index 5b6265adb6..adee01dca4 100644 --- a/lib/rules/jsx-sort-props.js +++ b/lib/rules/jsx-sort-props.js @@ -203,6 +203,7 @@ function validateReservedFirstConfig(context, reservedFirst) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce props alphabetical sorting', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-space-before-closing.js b/lib/rules/jsx-space-before-closing.js index 284aa06784..1d211598cc 100644 --- a/lib/rules/jsx-space-before-closing.js +++ b/lib/rules/jsx-space-before-closing.js @@ -18,6 +18,7 @@ let isWarnedForDeprecation = false; module.exports = { meta: { + type: 'layout', deprecated: true, docs: { description: 'Validate spacing before closing bracket in JSX', @@ -25,7 +26,7 @@ module.exports = { recommended: false, url: docsUrl('jsx-space-before-closing') }, - fixable: 'code', + fixable: 'whitespace', schema: [{ enum: ['always', 'never'] diff --git a/lib/rules/jsx-tag-spacing.js b/lib/rules/jsx-tag-spacing.js index 9568672ac6..1dce2a5201 100644 --- a/lib/rules/jsx-tag-spacing.js +++ b/lib/rules/jsx-tag-spacing.js @@ -228,6 +228,7 @@ const optionDefaults = { module.exports = { meta: { + type: 'layout', docs: { description: 'Validate whitespace in and around the JSX opening and closing brackets', category: 'Stylistic Issues', diff --git a/lib/rules/jsx-uses-react.js b/lib/rules/jsx-uses-react.js index bebcdf3cfa..51d289f048 100644 --- a/lib/rules/jsx-uses-react.js +++ b/lib/rules/jsx-uses-react.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent React to be marked as unused', category: 'Best Practices', diff --git a/lib/rules/jsx-uses-vars.js b/lib/rules/jsx-uses-vars.js index 86a32f1f46..e46987a241 100644 --- a/lib/rules/jsx-uses-vars.js +++ b/lib/rules/jsx-uses-vars.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent variables used in JSX to be marked as unused', category: 'Best Practices', diff --git a/lib/rules/jsx-wrap-multilines.js b/lib/rules/jsx-wrap-multilines.js index 2980a7652b..82d11480a6 100644 --- a/lib/rules/jsx-wrap-multilines.js +++ b/lib/rules/jsx-wrap-multilines.js @@ -32,6 +32,7 @@ const PARENS_NEW_LINES = 'Parentheses around JSX should be on separate lines'; module.exports = { meta: { + type: 'layout', docs: { description: 'Prevent missing parentheses around multilines JSX', category: 'Stylistic Issues', diff --git a/lib/rules/no-access-state-in-setstate.js b/lib/rules/no-access-state-in-setstate.js index 9a0af61d61..d44d90149e 100644 --- a/lib/rules/no-access-state-in-setstate.js +++ b/lib/rules/no-access-state-in-setstate.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Reports when this.state is accessed within setState', category: 'Possible Errors', diff --git a/lib/rules/no-adjacent-inline-elements.js b/lib/rules/no-adjacent-inline-elements.js index bdddd79bef..4b740cc0b8 100644 --- a/lib/rules/no-adjacent-inline-elements.js +++ b/lib/rules/no-adjacent-inline-elements.js @@ -71,6 +71,7 @@ const ERROR = 'Child elements which render as inline HTML elements should be sep // ------------------------------------------------------------------------------ module.exports = { + type: 'suggestion', ERROR, meta: { docs: { diff --git a/lib/rules/no-array-index-key.js b/lib/rules/no-array-index-key.js index 0a81bc8100..6cfaa968e4 100644 --- a/lib/rules/no-array-index-key.js +++ b/lib/rules/no-array-index-key.js @@ -16,9 +16,10 @@ const pragma = require('../util/pragma'); module.exports = { meta: { + type: 'problem', docs: { description: 'Prevent usage of Array index in keys', - category: 'Best Practices', + category: 'Possible Errors', recommended: false, url: docsUrl('no-array-index-key') }, diff --git a/lib/rules/no-children-prop.js b/lib/rules/no-children-prop.js index 0e9e011bf7..21c22aeb9a 100644 --- a/lib/rules/no-children-prop.js +++ b/lib/rules/no-children-prop.js @@ -31,6 +31,7 @@ function isCreateElementWithProps(node) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent passing of children as props.', category: 'Best Practices', diff --git a/lib/rules/no-danger-with-children.js b/lib/rules/no-danger-with-children.js index 66eb7f70a6..a8ab469be5 100644 --- a/lib/rules/no-danger-with-children.js +++ b/lib/rules/no-danger-with-children.js @@ -14,9 +14,10 @@ const docsUrl = require('../util/docsUrl'); // ------------------------------------------------------------------------------ module.exports = { meta: { + type: 'problem', docs: { description: 'Report when a DOM element is using both children and dangerouslySetInnerHTML', - category: '', + category: 'Possible Errors', recommended: true, url: docsUrl('no-danger-with-children') }, diff --git a/lib/rules/no-danger.js b/lib/rules/no-danger.js index 9322c090fe..159b414a4a 100644 --- a/lib/rules/no-danger.js +++ b/lib/rules/no-danger.js @@ -42,6 +42,7 @@ function isDangerous(name) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of dangerous JSX props', category: 'Best Practices', diff --git a/lib/rules/no-deprecated.js b/lib/rules/no-deprecated.js index da354eb29f..544b38dc71 100644 --- a/lib/rules/no-deprecated.js +++ b/lib/rules/no-deprecated.js @@ -32,6 +32,7 @@ const DEPRECATED_MESSAGE = '{{oldMethod}} is deprecated since React {{version}}{ module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of deprecated methods', category: 'Best Practices', diff --git a/lib/rules/no-direct-mutation-state.js b/lib/rules/no-direct-mutation-state.js index 816fbeb3d2..1741b73726 100644 --- a/lib/rules/no-direct-mutation-state.js +++ b/lib/rules/no-direct-mutation-state.js @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Prevent direct mutation of this.state', category: 'Possible Errors', diff --git a/lib/rules/no-find-dom-node.js b/lib/rules/no-find-dom-node.js index f62e821136..1dd54ca659 100644 --- a/lib/rules/no-find-dom-node.js +++ b/lib/rules/no-find-dom-node.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of findDOMNode', category: 'Best Practices', diff --git a/lib/rules/no-is-mounted.js b/lib/rules/no-is-mounted.js index 3132079831..90b8a73dcc 100644 --- a/lib/rules/no-is-mounted.js +++ b/lib/rules/no-is-mounted.js @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of isMounted', category: 'Best Practices', diff --git a/lib/rules/no-multi-comp.js b/lib/rules/no-multi-comp.js index 12c5bf8359..336ad4cdf4 100644 --- a/lib/rules/no-multi-comp.js +++ b/lib/rules/no-multi-comp.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent multiple component definition per file', category: 'Stylistic Issues', diff --git a/lib/rules/no-redundant-should-component-update.js b/lib/rules/no-redundant-should-component-update.js index 3321dffe6f..04954d3156 100644 --- a/lib/rules/no-redundant-should-component-update.js +++ b/lib/rules/no-redundant-should-component-update.js @@ -18,6 +18,7 @@ function errorMessage(node) { module.exports = { meta: { + type: 'problem', docs: { description: 'Flag shouldComponentUpdate when extending PureComponent', category: 'Possible Errors', diff --git a/lib/rules/no-render-return-value.js b/lib/rules/no-render-return-value.js index 103887d441..9fc003f07c 100644 --- a/lib/rules/no-render-return-value.js +++ b/lib/rules/no-render-return-value.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of the return value of React.render', category: 'Best Practices', diff --git a/lib/rules/no-set-state.js b/lib/rules/no-set-state.js index 7e0c67fe9a..186be74847 100644 --- a/lib/rules/no-set-state.js +++ b/lib/rules/no-set-state.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of setState', category: 'Stylistic Issues', diff --git a/lib/rules/no-string-refs.js b/lib/rules/no-string-refs.js index 96ebc2e48c..3b867b55ca 100644 --- a/lib/rules/no-string-refs.js +++ b/lib/rules/no-string-refs.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent string definitions for references and prevent referencing this.refs', category: 'Best Practices', diff --git a/lib/rules/no-this-in-sfc.js b/lib/rules/no-this-in-sfc.js index df86ba55ca..ceccc66dba 100644 --- a/lib/rules/no-this-in-sfc.js +++ b/lib/rules/no-this-in-sfc.js @@ -19,6 +19,7 @@ const ERROR_MESSAGE = 'Stateless functional components should not use this'; module.exports = { meta: { + type: 'problem', docs: { description: 'Report "this" being used in stateless components', category: 'Possible Errors', diff --git a/lib/rules/no-typos.js b/lib/rules/no-typos.js index ec1d6a25d6..0ebb74ff3b 100644 --- a/lib/rules/no-typos.js +++ b/lib/rules/no-typos.js @@ -33,6 +33,7 @@ const LIFECYCLE_METHODS = [ module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent common typos', category: 'Stylistic Issues', diff --git a/lib/rules/no-unescaped-entities.js b/lib/rules/no-unescaped-entities.js index e42e140a68..3a60290510 100644 --- a/lib/rules/no-unescaped-entities.js +++ b/lib/rules/no-unescaped-entities.js @@ -31,6 +31,7 @@ const DEFAULTS = [{ module.exports = { meta: { + type: 'problem', docs: { description: 'Detect unescaped HTML entities, which might represent malformed tags', category: 'Possible Errors', diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 9152f5e9c8..3238dd3da0 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -218,6 +218,7 @@ function getStandardName(name, context) { module.exports = { meta: { + type: 'problem', docs: { description: 'Prevent usage of unknown DOM property', category: 'Possible Errors', diff --git a/lib/rules/no-unsafe.js b/lib/rules/no-unsafe.js index 59b691b461..39f7073adc 100644 --- a/lib/rules/no-unsafe.js +++ b/lib/rules/no-unsafe.js @@ -16,6 +16,7 @@ const versionUtil = require('../util/version'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent usage of unsafe lifecycle methods', category: 'Best Practices', diff --git a/lib/rules/no-unused-prop-types.js b/lib/rules/no-unused-prop-types.js index 2fcda62fe1..a9b41c6859 100644 --- a/lib/rules/no-unused-prop-types.js +++ b/lib/rules/no-unused-prop-types.js @@ -17,6 +17,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent definitions of unused prop types', category: 'Best Practices', diff --git a/lib/rules/no-unused-state.js b/lib/rules/no-unused-state.js index 05bc08b29a..e3cbc022c0 100644 --- a/lib/rules/no-unused-state.js +++ b/lib/rules/no-unused-state.js @@ -74,6 +74,7 @@ function isSetStateCall(node) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent definition of unused state fields', category: 'Best Practices', diff --git a/lib/rules/prefer-es6-class.js b/lib/rules/prefer-es6-class.js index b35a85b969..c5500cc5a8 100644 --- a/lib/rules/prefer-es6-class.js +++ b/lib/rules/prefer-es6-class.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce ES5 or ES6 class for React Components', category: 'Stylistic Issues', diff --git a/lib/rules/prefer-read-only-props.js b/lib/rules/prefer-read-only-props.js index 8349435f24..0a25c0d121 100644 --- a/lib/rules/prefer-read-only-props.js +++ b/lib/rules/prefer-read-only-props.js @@ -22,6 +22,7 @@ function isCovariant(node) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Require read-only props.', category: 'Stylistic Issues', diff --git a/lib/rules/prefer-stateless-function.js b/lib/rules/prefer-stateless-function.js index e128b2d6bf..f55c948a47 100644 --- a/lib/rules/prefer-stateless-function.js +++ b/lib/rules/prefer-stateless-function.js @@ -18,6 +18,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce stateless components to be written as a pure function', category: 'Stylistic Issues', diff --git a/lib/rules/prop-types.js b/lib/rules/prop-types.js index a97483371c..aba97ac66f 100644 --- a/lib/rules/prop-types.js +++ b/lib/rules/prop-types.js @@ -17,6 +17,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent missing props validation in a React component definition', category: 'Best Practices', diff --git a/lib/rules/react-in-jsx-scope.js b/lib/rules/react-in-jsx-scope.js index 9df35dab76..369f2620e9 100644 --- a/lib/rules/react-in-jsx-scope.js +++ b/lib/rules/react-in-jsx-scope.js @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Prevent missing React when using JSX', category: 'Possible Errors', diff --git a/lib/rules/require-default-props.js b/lib/rules/require-default-props.js index e744f057b6..48cdc5d3e9 100644 --- a/lib/rules/require-default-props.js +++ b/lib/rules/require-default-props.js @@ -15,6 +15,7 @@ const astUtil = require('../util/ast'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce a defaultProps definition for every prop that is not a required prop.', category: 'Best Practices', diff --git a/lib/rules/require-optimization.js b/lib/rules/require-optimization.js index ee56e82b8e..3b7f632811 100644 --- a/lib/rules/require-optimization.js +++ b/lib/rules/require-optimization.js @@ -10,6 +10,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce React components to have a shouldComponentUpdate method', category: 'Best Practices', diff --git a/lib/rules/require-render-return.js b/lib/rules/require-render-return.js index 3ce41c0ba6..fb839e2c1c 100644 --- a/lib/rules/require-render-return.js +++ b/lib/rules/require-render-return.js @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Enforce ES5 or ES6 class for returning value in render function', category: 'Possible Errors', diff --git a/lib/rules/self-closing-comp.js b/lib/rules/self-closing-comp.js index 3e5150939e..c35ad1577a 100644 --- a/lib/rules/self-closing-comp.js +++ b/lib/rules/self-closing-comp.js @@ -16,6 +16,7 @@ const optionDefaults = {component: true, html: true}; module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent extra closing tags for components without children', category: 'Stylistic Issues', diff --git a/lib/rules/sort-comp.js b/lib/rules/sort-comp.js index c94670179e..0829c6387a 100644 --- a/lib/rules/sort-comp.js +++ b/lib/rules/sort-comp.js @@ -82,6 +82,7 @@ function getMethodsOrder(userConfig) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce component methods order', category: 'Stylistic Issues', diff --git a/lib/rules/sort-prop-types.js b/lib/rules/sort-prop-types.js index 9dbf13ad1a..61aebcb5ec 100644 --- a/lib/rules/sort-prop-types.js +++ b/lib/rules/sort-prop-types.js @@ -16,6 +16,7 @@ const propWrapperUtil = require('../util/propWrapper'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'Enforce propTypes declarations alphabetical sorting', category: 'Stylistic Issues', diff --git a/lib/rules/state-in-constructor.js b/lib/rules/state-in-constructor.js index 91a5d5d9db..edc667a307 100644 --- a/lib/rules/state-in-constructor.js +++ b/lib/rules/state-in-constructor.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'suggestion', docs: { description: 'State initialization in an ES6 class component should be in a constructor', category: 'Stylistic Issues', diff --git a/lib/rules/static-property-placement.js b/lib/rules/static-property-placement.js index 8e2a89a55a..9d3315b46e 100644 --- a/lib/rules/static-property-placement.js +++ b/lib/rules/static-property-placement.js @@ -49,13 +49,14 @@ const schemaProperties = fromEntries(classProperties.map(property => [property, module.exports = { meta: { + type: 'suggestion', docs: { description: 'Defines where React component static properties should be positioned.', category: 'Stylistic Issues', recommended: false, url: docsUrl('static-property-placement') }, - fixable: null, // or 'code' or 'whitespace' + // fixable: null, // or 'code' or 'whitespace' schema: [ {enum: POSITION_SETTINGS}, { diff --git a/lib/rules/style-prop-object.js b/lib/rules/style-prop-object.js index 5061aa0ea0..fb330eb2af 100644 --- a/lib/rules/style-prop-object.js +++ b/lib/rules/style-prop-object.js @@ -14,9 +14,10 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { + type: 'problem', docs: { description: 'Enforce style prop value is an object', - category: '', + category: 'Possible Errors', recommended: false, url: docsUrl('style-prop-object') }, diff --git a/lib/rules/void-dom-elements-no-children.js b/lib/rules/void-dom-elements-no-children.js index d25cc49dde..e821ce19de 100644 --- a/lib/rules/void-dom-elements-no-children.js +++ b/lib/rules/void-dom-elements-no-children.js @@ -50,6 +50,7 @@ function errorMessage(elementName) { module.exports = { meta: { + type: 'suggestion', docs: { description: 'Prevent passing of children to void DOM elements (e.g. `
`).', category: 'Best Practices', diff --git a/lib/util/makeNoMethodSetStateRule.js b/lib/util/makeNoMethodSetStateRule.js index 3a46b5e93b..0eefb53fd0 100644 --- a/lib/util/makeNoMethodSetStateRule.js +++ b/lib/util/makeNoMethodSetStateRule.js @@ -27,6 +27,7 @@ function mapTitle(methodName) { function makeNoMethodSetStateRule(methodName, shouldCheckUnsafeCb) { return { meta: { + type: 'suggestion', docs: { description: `Prevent usage of setState in ${methodName}`, category: 'Best Practices', From 4d4eea980dad0e206d7cfee91a8376039782b711 Mon Sep 17 00:00:00 2001 From: Vlad Esin <44160260+svetley1@users.noreply.github.com> Date: Fri, 17 Apr 2020 01:40:34 +0500 Subject: [PATCH 2/5] Apply suggestions from code review Co-Authored-By: Jordan Harband --- lib/rules/jsx-no-comment-textnodes.js | 2 +- lib/rules/void-dom-elements-no-children.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rules/jsx-no-comment-textnodes.js b/lib/rules/jsx-no-comment-textnodes.js index 888d0077d1..6b0af40401 100644 --- a/lib/rules/jsx-no-comment-textnodes.js +++ b/lib/rules/jsx-no-comment-textnodes.js @@ -31,7 +31,7 @@ function checkText(node, context) { module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Comments inside children section of tag should be placed inside braces', category: 'Possible Errors', diff --git a/lib/rules/void-dom-elements-no-children.js b/lib/rules/void-dom-elements-no-children.js index e821ce19de..2d27885c18 100644 --- a/lib/rules/void-dom-elements-no-children.js +++ b/lib/rules/void-dom-elements-no-children.js @@ -50,7 +50,7 @@ function errorMessage(elementName) { module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Prevent passing of children to void DOM elements (e.g. `
`).', category: 'Best Practices', From b97e0285a6e64e9d43af7a7b0a6e316e029ef2da Mon Sep 17 00:00:00 2001 From: Vlad Esin <44160260+svetley1@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:55:30 +0500 Subject: [PATCH 3/5] Apply suggestions from code review Co-Authored-By: Jordan Harband --- lib/rules/forbid-dom-props.js | 2 +- lib/rules/forbid-elements.js | 2 +- lib/rules/jsx-child-element-spacing.js | 1 - lib/rules/static-property-placement.js | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/rules/forbid-dom-props.js b/lib/rules/forbid-dom-props.js index c88cf8e9fb..09f8eec526 100644 --- a/lib/rules/forbid-dom-props.js +++ b/lib/rules/forbid-dom-props.js @@ -19,7 +19,7 @@ const DEFAULTS = []; module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Forbid certain props on DOM Nodes', category: 'Best Practices', diff --git a/lib/rules/forbid-elements.js b/lib/rules/forbid-elements.js index 977f32ea79..bdc09870eb 100644 --- a/lib/rules/forbid-elements.js +++ b/lib/rules/forbid-elements.js @@ -14,7 +14,7 @@ const docsUrl = require('../util/docsUrl'); module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Forbid certain elements', category: 'Best Practices', diff --git a/lib/rules/jsx-child-element-spacing.js b/lib/rules/jsx-child-element-spacing.js index 5d1fe0d3f4..686b274d48 100644 --- a/lib/rules/jsx-child-element-spacing.js +++ b/lib/rules/jsx-child-element-spacing.js @@ -46,7 +46,6 @@ module.exports = { recommended: false, url: docsUrl('jsx-child-element-spacing') }, - // fixable: null, schema: [ { type: 'object', diff --git a/lib/rules/static-property-placement.js b/lib/rules/static-property-placement.js index 9d3315b46e..e77af17174 100644 --- a/lib/rules/static-property-placement.js +++ b/lib/rules/static-property-placement.js @@ -56,7 +56,6 @@ module.exports = { recommended: false, url: docsUrl('static-property-placement') }, - // fixable: null, // or 'code' or 'whitespace' schema: [ {enum: POSITION_SETTINGS}, { From 8adffb3389613a9d9a9fff60d92fd844e93af769 Mon Sep 17 00:00:00 2001 From: Vlad Esin <44160260+svetley1@users.noreply.github.com> Date: Fri, 17 Apr 2020 20:02:47 +0500 Subject: [PATCH 4/5] Apply suggestions from code review --- lib/rules/forbid-component-props.js | 2 +- lib/rules/no-typos.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rules/forbid-component-props.js b/lib/rules/forbid-component-props.js index f2b0828e40..93ed233ac8 100644 --- a/lib/rules/forbid-component-props.js +++ b/lib/rules/forbid-component-props.js @@ -19,7 +19,7 @@ const DEFAULTS = ['className', 'style']; module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Forbid certain props on components', category: 'Best Practices', diff --git a/lib/rules/no-typos.js b/lib/rules/no-typos.js index 0ebb74ff3b..20757ab4ef 100644 --- a/lib/rules/no-typos.js +++ b/lib/rules/no-typos.js @@ -33,10 +33,10 @@ const LIFECYCLE_METHODS = [ module.exports = { meta: { - type: 'suggestion', + type: 'problem', docs: { description: 'Prevent common typos', - category: 'Stylistic Issues', + category: 'Possible Errors', recommended: false, url: docsUrl('no-typos') }, From 024755d5b57af63564cbeacb8b494d453205d959 Mon Sep 17 00:00:00 2001 From: Vlad Esin <44160260+svetley1@users.noreply.github.com> Date: Fri, 17 Apr 2020 20:32:06 +0500 Subject: [PATCH 5/5] Update void-dom-elements-no-children.js --- lib/rules/void-dom-elements-no-children.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/void-dom-elements-no-children.js b/lib/rules/void-dom-elements-no-children.js index 2d27885c18..db67b5f683 100644 --- a/lib/rules/void-dom-elements-no-children.js +++ b/lib/rules/void-dom-elements-no-children.js @@ -53,7 +53,7 @@ module.exports = { type: 'problem', docs: { description: 'Prevent passing of children to void DOM elements (e.g. `
`).', - category: 'Best Practices', + category: 'Possible Errors', recommended: false, url: docsUrl('void-dom-elements-no-children') },