diff --git a/lib/rules/boolean-prop-naming.js b/lib/rules/boolean-prop-naming.js index 6d63feb17e..9570b04054 100644 --- a/lib/rules/boolean-prop-naming.js +++ b/lib/rules/boolean-prop-naming.js @@ -22,6 +22,7 @@ const messages = { patternMismatch: 'Prop name `{{propName}}` doesn’t match rule `{{pattern}}`', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/default-props-match-prop-types.js b/lib/rules/default-props-match-prop-types.js index ba3db9328d..95b341650a 100644 --- a/lib/rules/default-props-match-prop-types.js +++ b/lib/rules/default-props-match-prop-types.js @@ -21,6 +21,7 @@ const messages = { defaultHasNoType: 'defaultProp "{{name}}" has no corresponding propTypes declaration.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/destructuring-assignment.js b/lib/rules/destructuring-assignment.js index e4abdaede9..e1a98d30a5 100644 --- a/lib/rules/destructuring-assignment.js +++ b/lib/rules/destructuring-assignment.js @@ -53,6 +53,7 @@ const messages = { destructureInSignature: 'Must destructure props in the function signature.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/display-name.js b/lib/rules/display-name.js index c1b3347117..b4de069542 100644 --- a/lib/rules/display-name.js +++ b/lib/rules/display-name.js @@ -27,6 +27,7 @@ const messages = { noContextDisplayName: 'Context definition is missing display name', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/forbid-component-props.js b/lib/rules/forbid-component-props.js index cca553e123..a72a5afafb 100644 --- a/lib/rules/forbid-component-props.js +++ b/lib/rules/forbid-component-props.js @@ -22,6 +22,7 @@ const messages = { propIsForbidden: 'Prop "{{prop}}" is forbidden on Components', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/forbid-dom-props.js b/lib/rules/forbid-dom-props.js index d5131af98d..4638a8700d 100644 --- a/lib/rules/forbid-dom-props.js +++ b/lib/rules/forbid-dom-props.js @@ -37,6 +37,7 @@ const messages = { propIsForbidden: 'Prop "{{prop}}" is forbidden on DOM Nodes', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/function-component-definition.js b/lib/rules/function-component-definition.js index f8a95a9da0..43e3154873 100644 --- a/lib/rules/function-component-definition.js +++ b/lib/rules/function-component-definition.js @@ -113,6 +113,7 @@ const messages = { 'arrow-function': 'Function component is not an arrow function', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/iframe-missing-sandbox.js b/lib/rules/iframe-missing-sandbox.js index 9a8bd4774d..810e30b52b 100644 --- a/lib/rules/iframe-missing-sandbox.js +++ b/lib/rules/iframe-missing-sandbox.js @@ -109,6 +109,7 @@ function checkProps(context, node) { } } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-boolean-value.js b/lib/rules/jsx-boolean-value.js index 0090c0a174..1cff171147 100644 --- a/lib/rules/jsx-boolean-value.js +++ b/lib/rules/jsx-boolean-value.js @@ -54,6 +54,7 @@ const messages = { omitPropAndBoolean: 'Value must be omitted for `false` attribute: `{{propName}}`', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-child-element-spacing.js b/lib/rules/jsx-child-element-spacing.js index d8d2af67ab..06807efcc6 100644 --- a/lib/rules/jsx-child-element-spacing.js +++ b/lib/rules/jsx-child-element-spacing.js @@ -44,6 +44,7 @@ const messages = { spacingBeforeNext: 'Ambiguous spacing before next element {{element}}', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-closing-tag-location.js b/lib/rules/jsx-closing-tag-location.js index ef68285513..5d5a95cb7b 100644 --- a/lib/rules/jsx-closing-tag-location.js +++ b/lib/rules/jsx-closing-tag-location.js @@ -18,6 +18,7 @@ const messages = { matchIndent: 'Expected closing tag to match indentation of opening.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-curly-brace-presence.js b/lib/rules/jsx-curly-brace-presence.js index c5467cc415..3eac3b47ea 100755 --- a/lib/rules/jsx-curly-brace-presence.js +++ b/lib/rules/jsx-curly-brace-presence.js @@ -36,6 +36,7 @@ const messages = { missingCurly: 'Need to wrap this literal in a JSX expression.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-curly-newline.js b/lib/rules/jsx-curly-newline.js index 77c2c82d8d..068a7103da 100644 --- a/lib/rules/jsx-curly-newline.js +++ b/lib/rules/jsx-curly-newline.js @@ -41,6 +41,7 @@ const messages = { unexpectedAfter: 'Unexpected newline after \'{\'.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { type: 'layout', diff --git a/lib/rules/jsx-filename-extension.js b/lib/rules/jsx-filename-extension.js index 578ffaf309..4a2cfeede6 100644 --- a/lib/rules/jsx-filename-extension.js +++ b/lib/rules/jsx-filename-extension.js @@ -28,6 +28,7 @@ const messages = { extensionOnlyForJSX: 'Only files containing JSX may use the extension \'{{ext}}\'', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-first-prop-new-line.js b/lib/rules/jsx-first-prop-new-line.js index 026ab384a0..7c9d969b51 100644 --- a/lib/rules/jsx-first-prop-new-line.js +++ b/lib/rules/jsx-first-prop-new-line.js @@ -17,6 +17,7 @@ const messages = { propOnSameLine: 'Property should be placed on the same line as the component declaration', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-handler-names.js b/lib/rules/jsx-handler-names.js index e82db76474..8ff56fb47a 100644 --- a/lib/rules/jsx-handler-names.js +++ b/lib/rules/jsx-handler-names.js @@ -17,6 +17,7 @@ const messages = { badPropKey: 'Prop key for {{propValue}} must begin with \'{{handlerPropPrefix}}\'', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-key.js b/lib/rules/jsx-key.js index c13a00cf83..7ea874d0ae 100644 --- a/lib/rules/jsx-key.js +++ b/lib/rules/jsx-key.js @@ -32,6 +32,7 @@ const messages = { nonUniqueKeys: '`key` prop must be unique', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-max-depth.js b/lib/rules/jsx-max-depth.js index 2ea6653351..01698264c7 100644 --- a/lib/rules/jsx-max-depth.js +++ b/lib/rules/jsx-max-depth.js @@ -20,6 +20,7 @@ const messages = { wrongDepth: 'Expected the depth of nested jsx elements to be <= {{needed}}, but found {{found}}.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-max-props-per-line.js b/lib/rules/jsx-max-props-per-line.js index 89e8748521..95d7942f9a 100644 --- a/lib/rules/jsx-max-props-per-line.js +++ b/lib/rules/jsx-max-props-per-line.js @@ -23,6 +23,7 @@ const messages = { newLine: 'Prop `{{prop}}` must be placed on a new line', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-newline.js b/lib/rules/jsx-newline.js index b4408e7cd8..966bf6a34b 100644 --- a/lib/rules/jsx-newline.js +++ b/lib/rules/jsx-newline.js @@ -23,6 +23,7 @@ function isMultilined(node) { return node && node.loc.start.line !== node.loc.end.line; } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-comment-textnodes.js b/lib/rules/jsx-no-comment-textnodes.js index b33cea0cce..2a90467d3f 100644 --- a/lib/rules/jsx-no-comment-textnodes.js +++ b/lib/rules/jsx-no-comment-textnodes.js @@ -33,6 +33,7 @@ function checkText(node, context) { } } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-constructed-context-values.js b/lib/rules/jsx-no-constructed-context-values.js index 8bcf045dad..f28c51fd4a 100644 --- a/lib/rules/jsx-no-constructed-context-values.js +++ b/lib/rules/jsx-no-constructed-context-values.js @@ -129,6 +129,7 @@ const messages = { defaultMsgFunc: 'The {{type}} passed as the value prop to the Context provider (at line {{nodeLine}}) changes every render. To fix this consider wrapping it in a useCallback hook.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-duplicate-props.js b/lib/rules/jsx-no-duplicate-props.js index 41e17828e2..cf7737698a 100644 --- a/lib/rules/jsx-no-duplicate-props.js +++ b/lib/rules/jsx-no-duplicate-props.js @@ -17,6 +17,7 @@ const messages = { noDuplicateProps: 'No duplicate props allowed', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-leaked-render.js b/lib/rules/jsx-no-leaked-render.js index b77cd576cc..a6bf54b72a 100644 --- a/lib/rules/jsx-no-leaked-render.js +++ b/lib/rules/jsx-no-leaked-render.js @@ -111,6 +111,7 @@ function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNod /** * @type {import('eslint').Rule.RuleModule} */ +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-literals.js b/lib/rules/jsx-no-literals.js index 41e6d0b828..ca4f3a8d46 100644 --- a/lib/rules/jsx-no-literals.js +++ b/lib/rules/jsx-no-literals.js @@ -27,6 +27,7 @@ const messages = { literalNotInJSXExpression: 'Missing JSX expression container around literal string: "{{text}}"', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-script-url.js b/lib/rules/jsx-no-script-url.js index bcf9468a24..b18ce2ccb3 100644 --- a/lib/rules/jsx-no-script-url.js +++ b/lib/rules/jsx-no-script-url.js @@ -43,6 +43,7 @@ const messages = { noScriptURL: 'A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML, try using dangerouslySetInnerHTML instead.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-target-blank.js b/lib/rules/jsx-no-target-blank.js index 795de8a70f..4ad12a464f 100644 --- a/lib/rules/jsx-no-target-blank.js +++ b/lib/rules/jsx-no-target-blank.js @@ -126,6 +126,7 @@ const messages = { noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noreferrer" or rel="noopener" (the former implies the latter and is preferred due to wider support) is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { fixable: 'code', diff --git a/lib/rules/jsx-no-undef.js b/lib/rules/jsx-no-undef.js index d7a42ccff2..3a1f4dbc5f 100644 --- a/lib/rules/jsx-no-undef.js +++ b/lib/rules/jsx-no-undef.js @@ -17,6 +17,7 @@ const messages = { undefined: '\'{{identifier}}\' is not defined.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-no-useless-fragment.js b/lib/rules/jsx-no-useless-fragment.js index 2d2711a5f9..303b9719e5 100644 --- a/lib/rules/jsx-no-useless-fragment.js +++ b/lib/rules/jsx-no-useless-fragment.js @@ -83,6 +83,7 @@ const messages = { ChildOfHtmlElement: 'Passing a fragment to an HTML element is useless.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { type: 'suggestion', diff --git a/lib/rules/jsx-one-expression-per-line.js b/lib/rules/jsx-one-expression-per-line.js index 4c5a9c970f..f18fa919e1 100644 --- a/lib/rules/jsx-one-expression-per-line.js +++ b/lib/rules/jsx-one-expression-per-line.js @@ -21,6 +21,7 @@ const messages = { moveToNewLine: '`{{descriptor}}` must be placed on a new line', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-pascal-case.js b/lib/rules/jsx-pascal-case.js index a1bb48116a..efeef4032a 100644 --- a/lib/rules/jsx-pascal-case.js +++ b/lib/rules/jsx-pascal-case.js @@ -76,6 +76,7 @@ const messages = { usePascalOrSnakeCase: 'Imported JSX component {{name}} must be in PascalCase or SCREAMING_SNAKE_CASE', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-props-no-multi-spaces.js b/lib/rules/jsx-props-no-multi-spaces.js index b9cabafe32..edd122c413 100644 --- a/lib/rules/jsx-props-no-multi-spaces.js +++ b/lib/rules/jsx-props-no-multi-spaces.js @@ -17,6 +17,7 @@ const messages = { onlyOneSpace: 'Expected only one space between “{{prop1}}” and “{{prop2}}”', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-props-no-spreading.js b/lib/rules/jsx-props-no-spreading.js index acbdea797a..a608011cd1 100644 --- a/lib/rules/jsx-props-no-spreading.js +++ b/lib/rules/jsx-props-no-spreading.js @@ -38,6 +38,7 @@ const messages = { noSpreading: 'Prop spreading is forbidden', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-sort-props.js b/lib/rules/jsx-sort-props.js index 6d19f201cd..3ca1724ebe 100644 --- a/lib/rules/jsx-sort-props.js +++ b/lib/rules/jsx-sort-props.js @@ -338,6 +338,7 @@ function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedLi }); } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-tag-spacing.js b/lib/rules/jsx-tag-spacing.js index e7c632b479..9cc18e8c37 100644 --- a/lib/rules/jsx-tag-spacing.js +++ b/lib/rules/jsx-tag-spacing.js @@ -255,6 +255,7 @@ const optionDefaults = { beforeClosing: 'allow', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/jsx-uses-react.js b/lib/rules/jsx-uses-react.js index 2bc2963d9e..bf06f508f8 100644 --- a/lib/rules/jsx-uses-react.js +++ b/lib/rules/jsx-uses-react.js @@ -12,6 +12,7 @@ const docsUrl = require('../util/docsUrl'); // Rule Definition // ------------------------------------------------------------------------------ +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { // eslint-disable-next-line eslint-plugin/prefer-message-ids -- https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/292 meta: { diff --git a/lib/rules/jsx-uses-vars.js b/lib/rules/jsx-uses-vars.js index a178d50565..9ea9ab001e 100644 --- a/lib/rules/jsx-uses-vars.js +++ b/lib/rules/jsx-uses-vars.js @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl'); const isTagNameRe = /^[a-z]/; const isTagName = (name) => isTagNameRe.test(name); +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { // eslint-disable-next-line eslint-plugin/prefer-message-ids -- https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/292 meta: { diff --git a/lib/rules/jsx-wrap-multilines.js b/lib/rules/jsx-wrap-multilines.js index eb9359e773..59fa5f294b 100644 --- a/lib/rules/jsx-wrap-multilines.js +++ b/lib/rules/jsx-wrap-multilines.js @@ -35,6 +35,7 @@ const messages = { parensOnNewLines: 'Parentheses around JSX should be on separate lines', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-array-index-key.js b/lib/rules/no-array-index-key.js index 08ecd7a6a9..bc8c91f9ef 100644 --- a/lib/rules/no-array-index-key.js +++ b/lib/rules/no-array-index-key.js @@ -41,6 +41,7 @@ const messages = { noArrayIndex: 'Do not use Array index in keys', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-arrow-function-lifecycle.js b/lib/rules/no-arrow-function-lifecycle.js index d9be92540f..a1de789b81 100644 --- a/lib/rules/no-arrow-function-lifecycle.js +++ b/lib/rules/no-arrow-function-lifecycle.js @@ -32,6 +32,7 @@ const messages = { lifecycle: '{{propertyName}} is a React lifecycle method, and should not be an arrow function or in a class field. Use an instance method instead.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-danger.js b/lib/rules/no-danger.js index a7cf8b59f8..1cb0273739 100644 --- a/lib/rules/no-danger.js +++ b/lib/rules/no-danger.js @@ -43,6 +43,7 @@ const messages = { dangerousProp: 'Dangerous property \'{{name}}\' found', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-did-mount-set-state.js b/lib/rules/no-did-mount-set-state.js index a5705ef2df..ad70c3eb7b 100644 --- a/lib/rules/no-did-mount-set-state.js +++ b/lib/rules/no-did-mount-set-state.js @@ -7,4 +7,5 @@ const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule'); +/** @type {import('eslint').Rule.RuleModule} */ module.exports = makeNoMethodSetStateRule('componentDidMount'); diff --git a/lib/rules/no-did-update-set-state.js b/lib/rules/no-did-update-set-state.js index 5c76a1ff5b..d297fb2648 100644 --- a/lib/rules/no-did-update-set-state.js +++ b/lib/rules/no-did-update-set-state.js @@ -7,4 +7,5 @@ const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule'); +/** @type {import('eslint').Rule.RuleModule} */ module.exports = makeNoMethodSetStateRule('componentDidUpdate'); diff --git a/lib/rules/no-direct-mutation-state.js b/lib/rules/no-direct-mutation-state.js index 08d77e9bca..9349a85fe5 100644 --- a/lib/rules/no-direct-mutation-state.js +++ b/lib/rules/no-direct-mutation-state.js @@ -21,6 +21,7 @@ const messages = { noDirectMutation: 'Do not mutate state directly. Use setState().', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-multi-comp.js b/lib/rules/no-multi-comp.js index 31b9ef0d4e..76b3fa0af7 100644 --- a/lib/rules/no-multi-comp.js +++ b/lib/rules/no-multi-comp.js @@ -19,6 +19,7 @@ const messages = { onlyOneComponent: 'Declare only one React component per file', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-namespace.js b/lib/rules/no-namespace.js index 64bbc8d521..d7559f5ebd 100644 --- a/lib/rules/no-namespace.js +++ b/lib/rules/no-namespace.js @@ -18,6 +18,7 @@ const messages = { noNamespace: 'React component {{name}} must not be in a namespace, as React does not support them', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-object-type-as-default-prop.js b/lib/rules/no-object-type-as-default-prop.js index 2ba25889d8..7be98cb4b3 100644 --- a/lib/rules/no-object-type-as-default-prop.js +++ b/lib/rules/no-object-type-as-default-prop.js @@ -78,6 +78,7 @@ function verifyDefaultPropsDestructuring(context, properties) { }); } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-redundant-should-component-update.js b/lib/rules/no-redundant-should-component-update.js index bf7601a2c4..849191d176 100644 --- a/lib/rules/no-redundant-should-component-update.js +++ b/lib/rules/no-redundant-should-component-update.js @@ -17,6 +17,7 @@ const messages = { noShouldCompUpdate: '{{component}} does not need shouldComponentUpdate when extending React.PureComponent.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-set-state.js b/lib/rules/no-set-state.js index 486eb211ff..c88db30d7e 100644 --- a/lib/rules/no-set-state.js +++ b/lib/rules/no-set-state.js @@ -19,6 +19,7 @@ const messages = { noSetState: 'Do not use setState', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-string-refs.js b/lib/rules/no-string-refs.js index 2decbbe6bb..466a214579 100644 --- a/lib/rules/no-string-refs.js +++ b/lib/rules/no-string-refs.js @@ -18,6 +18,7 @@ const messages = { stringInRefDeprecated: 'Using string literals in ref attributes is deprecated.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-this-in-sfc.js b/lib/rules/no-this-in-sfc.js index 9c1535ef0b..cf9eb99bd4 100644 --- a/lib/rules/no-this-in-sfc.js +++ b/lib/rules/no-this-in-sfc.js @@ -16,6 +16,7 @@ const messages = { noThisInSFC: 'Stateless functional components should not use `this`', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-typos.js b/lib/rules/no-typos.js index ba826d523d..3d79d40b18 100644 --- a/lib/rules/no-typos.js +++ b/lib/rules/no-typos.js @@ -28,6 +28,7 @@ const messages = { noReactBinding: '`\'react\'` imported without a local `React` binding.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-unescaped-entities.js b/lib/rules/no-unescaped-entities.js index 3eaa7cd757..a449ad5206 100644 --- a/lib/rules/no-unescaped-entities.js +++ b/lib/rules/no-unescaped-entities.js @@ -35,6 +35,7 @@ const messages = { unescapedEntityAlts: '`{{entity}}` can be escaped with {{alts}}.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-unsafe.js b/lib/rules/no-unsafe.js index 3cfa48968e..66d828338a 100644 --- a/lib/rules/no-unsafe.js +++ b/lib/rules/no-unsafe.js @@ -19,6 +19,7 @@ const messages = { unsafeMethod: '{{method}} is unsafe for use in async rendering. Update the component to use {{newMethod}} instead. {{details}}', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-unstable-nested-components.js b/lib/rules/no-unstable-nested-components.js index 9b60e496bf..2ef635efab 100644 --- a/lib/rules/no-unstable-nested-components.js +++ b/lib/rules/no-unstable-nested-components.js @@ -265,6 +265,7 @@ function resolveComponentName(node) { // Rule Definition // ------------------------------------------------------------------------------ +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-unused-prop-types.js b/lib/rules/no-unused-prop-types.js index a3cf352aac..f72188201a 100644 --- a/lib/rules/no-unused-prop-types.js +++ b/lib/rules/no-unused-prop-types.js @@ -22,6 +22,7 @@ const messages = { unusedPropType: '\'{{name}}\' PropType is defined but prop is never used', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/no-will-update-set-state.js b/lib/rules/no-will-update-set-state.js index 4f84ee6724..16e6be43b9 100644 --- a/lib/rules/no-will-update-set-state.js +++ b/lib/rules/no-will-update-set-state.js @@ -8,6 +8,7 @@ const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule'); const testReactVersion = require('../util/version').testReactVersion; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = makeNoMethodSetStateRule( 'componentWillUpdate', (context) => testReactVersion(context, '>= 16.3.0') diff --git a/lib/rules/prefer-es6-class.js b/lib/rules/prefer-es6-class.js index 5ca020ebba..a7c1ff56fc 100644 --- a/lib/rules/prefer-es6-class.js +++ b/lib/rules/prefer-es6-class.js @@ -18,6 +18,7 @@ const messages = { shouldUseCreateClass: 'Component should use createClass instead of es6 class', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/prefer-exact-props.js b/lib/rules/prefer-exact-props.js index 037fa29914..4ad088e9ee 100644 --- a/lib/rules/prefer-exact-props.js +++ b/lib/rules/prefer-exact-props.js @@ -20,6 +20,7 @@ const messages = { flow: 'Component flow props should be set with exact objects.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/prefer-read-only-props.js b/lib/rules/prefer-read-only-props.js index 31d7114643..c00b09f9e4 100644 --- a/lib/rules/prefer-read-only-props.js +++ b/lib/rules/prefer-read-only-props.js @@ -47,6 +47,7 @@ const messages = { readOnlyProp: 'Prop \'{{name}}\' should be read-only.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/prefer-stateless-function.js b/lib/rules/prefer-stateless-function.js index 2743ea38aa..07c435747f 100644 --- a/lib/rules/prefer-stateless-function.js +++ b/lib/rules/prefer-stateless-function.js @@ -24,6 +24,7 @@ const messages = { componentShouldBePure: 'Component should be written as a pure function', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/prop-types.js b/lib/rules/prop-types.js index 9ab3640938..07adca104a 100644 --- a/lib/rules/prop-types.js +++ b/lib/rules/prop-types.js @@ -22,6 +22,7 @@ const messages = { missingPropType: '\'{{name}}\' is missing in props validation', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/react-in-jsx-scope.js b/lib/rules/react-in-jsx-scope.js index e1ee1b6d8c..1af398deae 100644 --- a/lib/rules/react-in-jsx-scope.js +++ b/lib/rules/react-in-jsx-scope.js @@ -18,6 +18,7 @@ const messages = { notInScope: '\'{{name}}\' must be in scope when using JSX', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/require-default-props.js b/lib/rules/require-default-props.js index c1b83bcff0..d1b27eefe1 100644 --- a/lib/rules/require-default-props.js +++ b/lib/rules/require-default-props.js @@ -24,6 +24,7 @@ const messages = { destructureInSignature: 'Must destructure props in the function signature to initialize an optional prop.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/require-optimization.js b/lib/rules/require-optimization.js index 05bd071fc6..9d440b19ee 100644 --- a/lib/rules/require-optimization.js +++ b/lib/rules/require-optimization.js @@ -16,6 +16,7 @@ const messages = { noShouldComponentUpdate: 'Component is not optimized. Please add a shouldComponentUpdate method.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/require-render-return.js b/lib/rules/require-render-return.js index cb06206952..d79c9406b7 100644 --- a/lib/rules/require-render-return.js +++ b/lib/rules/require-render-return.js @@ -21,6 +21,7 @@ const messages = { noRenderReturn: 'Your render method should have a return statement', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/self-closing-comp.js b/lib/rules/self-closing-comp.js index 2144db599e..fe5fda4d49 100644 --- a/lib/rules/self-closing-comp.js +++ b/lib/rules/self-closing-comp.js @@ -19,6 +19,7 @@ const messages = { notSelfClosing: 'Empty components are self-closing', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/sort-comp.js b/lib/rules/sort-comp.js index b56187a298..fb0bf8f614 100644 --- a/lib/rules/sort-comp.js +++ b/lib/rules/sort-comp.js @@ -86,6 +86,7 @@ const messages = { unsortedProps: '{{propA}} should be placed {{position}} {{propB}}', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/sort-prop-types.js b/lib/rules/sort-prop-types.js index 4a79aa5407..8c3574af4a 100644 --- a/lib/rules/sort-prop-types.js +++ b/lib/rules/sort-prop-types.js @@ -53,6 +53,7 @@ function toLowerCase(item) { return String(item).toLowerCase(); } +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/state-in-constructor.js b/lib/rules/state-in-constructor.js index e6cc87b283..c518b1713a 100644 --- a/lib/rules/state-in-constructor.js +++ b/lib/rules/state-in-constructor.js @@ -19,6 +19,7 @@ const messages = { stateInitClassProp: 'State initialization should be in a class property', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: { diff --git a/lib/rules/static-property-placement.js b/lib/rules/static-property-placement.js index 59f559121b..efc50da3bd 100644 --- a/lib/rules/static-property-placement.js +++ b/lib/rules/static-property-placement.js @@ -55,6 +55,7 @@ const messages = { declareOutsideClass: '\'{{name}}\' should be declared outside the class body.', }; +/** @type {import('eslint').Rule.RuleModule} */ module.exports = { meta: { docs: {