Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rule-tester): port checkDuplicateTestCases from ESLint #9026

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
620416d
port checkDuplicate from ESLint
abrahamguo Apr 29, 2024
72faa0d
lint
abrahamguo Apr 29, 2024
2870725
revert lib change
abrahamguo Apr 29, 2024
c0da154
move serialization to utils
abrahamguo Apr 29, 2024
4cab72b
add issuenum for Object.hasOwn
abrahamguo Apr 29, 2024
9cacae9
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo Apr 30, 2024
b4e0d87
test cases for duplication
abrahamguo Apr 30, 2024
c31e1be
dedupe some bulk tests
abrahamguo Apr 30, 2024
1f1a290
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo May 2, 2024
c2db7bd
dedupe naming-convention
abrahamguo May 2, 2024
646aa94
make utility
abrahamguo May 2, 2024
0a02368
prefer-nullish-coalescing
abrahamguo May 2, 2024
618307d
prefer-readonly-parameter-types
abrahamguo May 2, 2024
88efa1b
member-ordering
abrahamguo May 2, 2024
3e8231d
sort
abrahamguo May 2, 2024
fcae2d0
consistent-type-assertion
abrahamguo May 3, 2024
dd112cf
add comment
abrahamguo May 3, 2024
73c7a9d
cleanup
abrahamguo May 3, 2024
ddd20bb
fix formatting
abrahamguo May 3, 2024
ac89ac3
add explanation
abrahamguo May 3, 2024
146ae8f
func-call-spacing
abrahamguo May 3, 2024
b9617b5
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo May 3, 2024
ba8c6cc
remove naming-convention
abrahamguo May 3, 2024
6693ea3
remove debugging
abrahamguo May 3, 2024
4fe40ce
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo May 3, 2024
d136b04
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo May 28, 2024
3cf2411
change quotes
abrahamguo May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/eslint-plugin/tests/dedupeTestCases.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const dedupeTestCases = <T>(...caseArrays: (readonly T[])[]): T[] => {
const cases = caseArrays.flat();
const dedupedCases = Object.values(
Object.fromEntries(
cases.map(testCase => [JSON.stringify(testCase), testCase]),
),
);
if (cases.length === dedupedCases.length) {
throw new Error(
'`dedupeTestCases` is not necessary — no duplicate test cases detected!',
);
}
return dedupedCases;
};