Skip to content

Commit 89ad425

Browse files
committed
chore: revert some mistaken replaces
1 parent f5414d9 commit 89ad425

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.eslint-doc-generatorrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import prettier from 'prettier';
22

33
/** @type {import('eslint-doc-generator').GenerateOptions} */
4-
export default {
4+
const config = {
55
ignoreConfig: [
66
'all',
77
'all-type-checked',
@@ -27,3 +27,5 @@ export default {
2727
urlConfigs:
2828
'https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets',
2929
};
30+
31+
export default config;

lib/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ function getRuleExportsCJS(ast, scopeManager) {
220220
) {
221221
exportsVarOverridden = true;
222222
if (isFunctionRule(node.right)) {
223-
// Check `= function (context) { return { ... }; }`
223+
// Check `module.exports = function (context) { return { ... }; }`
224224

225225
exportsIsFunction = true;
226226
return { create: node.right, meta: null, isNewStyle: false };
227227
} else if (node.right.type === 'ObjectExpression') {
228-
// Check `= { create: function () {}, meta: {} }`
228+
// Check `module.exports = { create: function () {}, meta: {} }`
229229

230230
return collectInterestingProperties(
231231
node.right.properties,
@@ -236,13 +236,13 @@ function getRuleExportsCJS(ast, scopeManager) {
236236
const possibleRule = findVariableValue(node.right, scopeManager);
237237
if (possibleRule) {
238238
if (possibleRule.type === 'ObjectExpression') {
239-
// Check `const possibleRule = { ... }; = possibleRule;
239+
// Check `const possibleRule = { ... }; module.exports = possibleRule;
240240
return collectInterestingProperties(
241241
possibleRule.properties,
242242
INTERESTING_RULE_KEYS,
243243
);
244244
} else if (isFunctionRule(possibleRule)) {
245-
// Check `const possibleRule = function(context) { return { ... } }; = possibleRule;`
245+
// Check `const possibleRule = function(context) { return { ... } }; module.exports = possibleRule;`
246246
return { create: possibleRule, meta: null, isNewStyle: false };
247247
}
248248
}
@@ -258,7 +258,7 @@ function getRuleExportsCJS(ast, scopeManager) {
258258
node.left.property.type === 'Identifier' &&
259259
INTERESTING_RULE_KEYS.has(node.left.property.name)
260260
) {
261-
// Check `create = () => {}`
261+
// Check `module.exports.create = () => {}`
262262

263263
currentExports[node.left.property.name] = node.right;
264264
} else if (

0 commit comments

Comments
 (0)