Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
- naming of options
- using nullish coalescing assignment
  • Loading branch information
seiyab committed Aug 14, 2023
1 parent 7451956 commit 6ca18e1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/eslint-plugin/src/rules/prefer-destructuring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ export default createRule<Options, MessageIds>({
},
{},
],
create(context, [enabledTypes, options1 = {}]) {
create(context, [enabledTypes, options = {}]) {
const {
enforceForRenamedProperties = false,
enforceForDeclarationWithTypeAnnotation = false,
} = options1;
} = options;
const { program, esTreeNodeToTSNodeMap } = getParserServices(context);
const typeChecker = program.getTypeChecker();
const baseRules = baseRule.create(context);
Expand Down Expand Up @@ -173,9 +173,7 @@ export default createRule<Options, MessageIds>({
}

function baseRulesWithoutFix(): ReturnType<typeof baseRule.create> {
if (baseRulesWithoutFixCache == null) {
baseRulesWithoutFixCache = baseRule.create(noFixContext(context));
}
baseRulesWithoutFixCache ??= baseRule.create(noFixContext(context));
return baseRulesWithoutFixCache;
}
},
Expand Down

0 comments on commit 6ca18e1

Please sign in to comment.