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 'typescript' alias extension for 'ts' #424

Closed
wants to merge 1 commit into from
Closed

Add 'typescript' alias extension for 'ts' #424

wants to merge 1 commit into from

Conversation

thiagowfx
Copy link

@thiagowfx thiagowfx commented Nov 2, 2023

Precedent: JavaScript has both 'javascript' and 'js', this ensures consistency.

(edit: there's no 'js', my mistake)

Precedent: JavaScript has both 'javascript' and 'js', this ensures
consistency.
@asottile
Copy link
Member

asottile commented Nov 2, 2023

there's no js tag so there's no precedence

@asottile asottile closed this Nov 2, 2023
@thiagowfx thiagowfx deleted the typescript branch November 2, 2023 16:45
@thiagowfx
Copy link
Author

thiagowfx commented Nov 2, 2023

Maybe my point was misunderstood. https://github.com/pre-commit/identify/blob/main/identify/extensions.py

What I meant was this:

Status quo:

  • 'javascript' (no 'js' indeed as you say)
  • 'ts' (no 'typescript')

With this PR, status quo:

  • 'javascript'
  • 'typescript'
  • 'ts'

The rationale is: When using pre-commit with a kind filter, it has to be written like this: https://github.com/GoogleChromeLabs/chromium-bidi/blob/fc2d6847cc4c5dd10a46693055c7faa7827079f4/.pre-commit-config.yaml#L111

        types_or: [javascript, ts, python]

However, one would expect the following to be valid (but it's not!):

        types_or: [javascript, typescript, python]

...this PR intended to fix this inconsistency.

The precedence is for 'javascript'.

@asottile
Copy link
Member

asottile commented Nov 2, 2023

search the issue tracker -- this inconsistency has been discussed before with resolution as to why it is not changing

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

Successfully merging this pull request may close these issues.

2 participants