Skip to content

Commit

Permalink
Fix error in generated types
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Sep 23, 2024
1 parent 261bee8 commit f3fb32c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rules/jsx-no-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ const elementOverrides = {
},
};

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
meta: /** @type {import('eslint').Rule.RuleModule["meta"]} */ ({
docs: {
description: 'Disallow usage of string literals in JSX',
category: 'Stylistic Issues',
Expand All @@ -202,7 +201,7 @@ module.exports = {
),
additionalProperties: false,
}],
},
}),

create(context) {
/** @type {RawConfig} */
Expand Down
7 changes: 7 additions & 0 deletions lib/util/makeNoMethodSetStateRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ function shouldBeNoop(context, methodName) {
&& !testReactVersion(context, '999.999.999'); // for when the version is not specified
}

// eslint-disable-next-line valid-jsdoc
/**
* @param {string} methodName Yay
* @param {(context: import('eslint').Rule.RuleContext) => boolean} [shouldCheckUnsafeCb] Yay
* @returns {import('eslint').Rule.RuleModule}
*/
module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafeCb) {
return {
meta: {
Expand Down Expand Up @@ -90,6 +96,7 @@ module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafe
if (
callee.type !== 'MemberExpression'
|| callee.object.type !== 'ThisExpression'
|| !('name' in callee.property)
|| callee.property.name !== 'setState'
) {
return;
Expand Down

0 comments on commit f3fb32c

Please sign in to comment.