Skip to content

Commit 7276474

Browse files
committed
chore: update sorting methods to use toSorted for improved readability
1 parent 29420d6 commit 7276474

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default defineConfig([
3737
files: ['**/*.{js,ts}'],
3838
languageOptions: { parser: tseslint.parser, sourceType: 'module' },
3939
plugins: { js, n, 'eslint-plugin': eslintPlugin },
40-
extends: [prettier, "js/recommended", "n/recommended", unicorn.configs.recommended, eslintComments.recommended],
40+
extends: [prettier, "js/recommended", tseslint.configs.recommended, "n/recommended", unicorn.configs.recommended, eslintComments.recommended],
4141
rules: {
4242
'n/no-missing-import': 'off',
4343

lib/rules/meta-property-ordering.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const rule: Rule.RuleModule = {
8686

8787
const knownProps = props
8888
.filter((prop) => orderMap.has(getKeyName(prop)))
89-
.sort(
89+
.toSorted(
9090
(a, b) =>
9191
orderMap.get(getKeyName(a))! - orderMap.get(getKeyName(b))!,
9292
);

lib/rules/no-identical-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const rule: Rule.RuleModule = {
3838
}
3939
return JSON.stringify([
4040
test.type,
41-
...test.properties.map((p) => sourceCode.getText(p)).sort(),
41+
...test.properties.map((p) => sourceCode.getText(p)).toSorted(),
4242
]);
4343
}
4444

0 commit comments

Comments
 (0)