Skip to content

Commit f3fb32c

Browse files
committed
Fix error in generated types
1 parent 261bee8 commit f3fb32c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/rules/jsx-no-literals.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ const elementOverrides = {
182182
},
183183
};
184184

185-
/** @type {import('eslint').Rule.RuleModule} */
186185
module.exports = {
187-
meta: {
186+
meta: /** @type {import('eslint').Rule.RuleModule["meta"]} */ ({
188187
docs: {
189188
description: 'Disallow usage of string literals in JSX',
190189
category: 'Stylistic Issues',
@@ -202,7 +201,7 @@ module.exports = {
202201
),
203202
additionalProperties: false,
204203
}],
205-
},
204+
}),
206205

207206
create(context) {
208207
/** @type {RawConfig} */

lib/util/makeNoMethodSetStateRule.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ function shouldBeNoop(context, methodName) {
4444
&& !testReactVersion(context, '999.999.999'); // for when the version is not specified
4545
}
4646

47+
// eslint-disable-next-line valid-jsdoc
48+
/**
49+
* @param {string} methodName Yay
50+
* @param {(context: import('eslint').Rule.RuleContext) => boolean} [shouldCheckUnsafeCb] Yay
51+
* @returns {import('eslint').Rule.RuleModule}
52+
*/
4753
module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafeCb) {
4854
return {
4955
meta: {
@@ -90,6 +96,7 @@ module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafe
9096
if (
9197
callee.type !== 'MemberExpression'
9298
|| callee.object.type !== 'ThisExpression'
99+
|| !('name' in callee.property)
93100
|| callee.property.name !== 'setState'
94101
) {
95102
return;

0 commit comments

Comments
 (0)