Skip to content

Commit

Permalink
Escape $ in file paths
Browse files Browse the repository at this point in the history
The `$` character in file paths gets treated as a variable by Sublime Text. And as a result, ESLint fails to lint TS files that are "not included" because the path doesn't match any that tsconfig has included.

For example, `/some/long/file.$path.ts` becomes `/some/long/file..ts`

With this change, the `$` is escaped and therefore the full path stays in tact.
  • Loading branch information
amsul authored and kaste committed Nov 10, 2023
1 parent e502cc4 commit 7a357c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def cmd(self):
cmd = ['eslint', '--format=json', '--stdin']
stdin_filename = self.get_stdin_filename()
if stdin_filename:
cmd.append('--stdin-filename=' + stdin_filename)
cmd.append('--stdin-filename=' + stdin_filename.replace('$', '\\$'))
return cmd

def run(self, cmd, code):
Expand Down

0 comments on commit 7a357c5

Please sign in to comment.