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 .ts and .tsx support #1738

Merged
merged 1 commit into from
Sep 14, 2019
Merged

Add .ts and .tsx support #1738

merged 1 commit into from
Sep 14, 2019

Conversation

brendanoffer
Copy link
Contributor

Add TS and TSX support to ESLint.

Typescript linting has been done in the past by TSLint, which is now being deprecated. The TSLint team is pointing users to use @typescript-eslint for typescript support; the Microsoft Typescript team, themselves, have been transferring their linting capabilities to use ESLint.

If users do not want their typescript files to be linted support they can simply add *.ts and *.tsx to their .eslintignore file.

@@ -1,6 +1,6 @@
module Linter
class Eslint < Base
FILE_REGEXP = /.+(\.js|\.es6|\.jsx|\.vue)\z/
FILE_REGEXP = /.+(\.js|\.es6|\.jsx|\.vue|\.ts|\.tsx)\z/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Freeze mutable objects assigned to constants.

@gylaz
Copy link
Member

gylaz commented Aug 27, 2019

Thanks @brendanoffer. Would you mind fixing the Hound violation?

Additionally, I'm wondering if we need a specific guard to avoid unexpected linting of TS files for our current users. Those users are most likely using TSLint. If they also have ESLint enabled for some reason, will they see similar comments from 2 linters?

@brendanoffer
Copy link
Contributor Author

@gylaz I can add freeze here if you like though I am not sure it is the best approach. I don't see any other regex's in the hound codebase being frozen.

Here is a Rubocop thread about freezing non-strings
rubocop/rubocop#6331

@brendanoffer
Copy link
Contributor Author

@gylaz any guidance?

@gylaz gylaz merged commit 5e5d91c into houndci:master Sep 14, 2019
@gylaz
Copy link
Member

gylaz commented Sep 14, 2019

Thanks @brendanoffer! Merging this as-is. We'll see if we get any feedback about potentially linting TS files with both ESLint and TSLint (and how often that arises).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants