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

Add mts as a typescript extension #478

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions linters/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ lint:
extensions:
- ts
- tsx
- mts
comments:
- slashes-inline
- slashes-block
Expand Down
5 changes: 3 additions & 2 deletions tests/repo_tests/test_coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ describe("All linters must have tests", () => {
const stdout = execSync("npm test -- --listTests", { cwd: REPO_ROOT }).toString();
const testFiles = stdout
.split("\n")
.filter((file) => file.startsWith("/"))
.filter((file) => file.startsWith("/") || file.match(/[A-Z]:\\/))
.map((file) => path.relative(REPO_ROOT, file));

// Key the tests by their linter subdirectory
const testDirMap = testFiles.reduce((accumulator: Map<string, string[]>, file: string) => {
const linterSubdir = file.match(/linters\/[^/]+/);
const linterSubdir =
process.platform === "win32" ? file.match(/linters\\[^\\]+/) : file.match(/linters\/[^/]+/);
if (linterSubdir) {
const matches = accumulator.get(linterSubdir[0]) ?? [];
accumulator.set(linterSubdir[0], [...matches, file]);
Expand Down