Skip to content

Commit 2124d13

Browse files
bradzacherljharb
authored andcommitted
[Fix] add a few jsdoc type annotations to work around TS inference for consumers
1 parent bd55ca2 commit 2124d13

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

configs/all.js

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ function filterRules(rules, predicate) {
99
return fromEntries(entries(rules).filter((entry) => predicate(entry[1])));
1010
}
1111

12+
/**
13+
* @param {object} rules - rules object mapping rule name to rule module
14+
* @returns {Record<string, 2>}
15+
*/
1216
function configureAsError(rules) {
1317
return fromEntries(Object.keys(rules).map((key) => [`react/${key}`, 2]));
1418
}
@@ -20,6 +24,12 @@ const deprecatedRules = filterRules(allRules, (rule) => rule.meta.deprecated);
2024

2125
module.exports = {
2226
plugins: {
27+
/**
28+
* @type {{
29+
* deprecatedRules: Record<string, import('eslint').Rule.RuleModule>,
30+
* rules: Record<string, import('eslint').Rule.RuleModule>,
31+
* }}
32+
*/
2333
react: {
2434
deprecatedRules,
2535
rules: allRules,

lib/rules/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/* eslint global-require: 0 */
44

5+
/** @type {Record<string, import('eslint').Rule.RuleModule>} */
56
module.exports = {
67
'boolean-prop-naming': require('./boolean-prop-naming'),
78
'button-has-type': require('./button-has-type'),

0 commit comments

Comments
 (0)