Skip to content

Commit

Permalink
Add mts as a typescript extension (#478)
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Jang <tyler@trunk.io>
  • Loading branch information
dapirian and TylerJang27 authored Sep 20, 2023
1 parent f2b1892 commit 4baea58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 4baea58

Please sign in to comment.