Skip to content

Commit b5ce43b

Browse files
authored
chore(eslint-plugin): replaced map/reduce with flatMap in normalizedOptions in parse (#9122)
fix(naming-convention-utils): optimized normalizedOptions in parse
1 parent c18226e commit b5ce43b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/eslint-plugin/src/rules/naming-convention-utils/parse-options.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ function normalizeOption(option: Selector): NormalizedSelector[] {
8080
}
8181

8282
function parseOptions(context: Context): ParsedOptions {
83-
const normalizedOptions = context.options
84-
.map(opt => normalizeOption(opt))
85-
.reduce((acc, val) => acc.concat(val), []);
83+
const normalizedOptions = context.options.flatMap(normalizeOption);
8684

8785
const result = getEnumNames(Selectors).reduce((acc, k) => {
8886
acc[k] = createValidator(k, context, normalizedOptions);

0 commit comments

Comments
 (0)