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

Introduce custom rules for i18n imports #67

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

davidtaylorhq
Copy link
Member

@davidtaylorhq davidtaylorhq commented May 31, 2024

Before:

  • import i18n from discourse-common/helpers/i18n; -> i18n()
  • import I18n from "discourse-i18n"; -> I18n.t()
  • import I18n from "i18n"; -> I18n.t()

After:

  • import { i18n } from "discourse-i18n"; -> i18n()

These rules remain disabled by default. We can enable them by default once discourse/discourse@d606ac3d8e is widely available.

davidtaylorhq added a commit to discourse/discourse that referenced this pull request Nov 19, 2024
Soon, we intend to consolidate all js/gjs translation calls to this new function. See discourse/lint-configs#67 and #29804
davidtaylorhq added a commit to discourse/discourse that referenced this pull request Nov 19, 2024
Soon, we intend to consolidate all js/gjs translation calls to this new function. See discourse/lint-configs#67 and #29804
Before:

- `import i18n from discourse-common/helpers/i18n;` -> `i18n()`
- `import I18n from "discourse-i18n";` -> `I18n.t()`
- `import I18n from "i18n";` -> `I18n.t()`

After:

- `import { i18n } from "discourse-i18n";` -> `i18n()`

These rules remain disabled by default. We can enable them by default once discourse/discourse@d606ac3d8e is widely available.
@davidtaylorhq davidtaylorhq changed the title Add custom rule which autofixes "i18n" -> "discourse-i18n" Introduce custom rules for i18n imports Nov 19, 2024
@davidtaylorhq davidtaylorhq marked this pull request as ready for review November 19, 2024 13:07
Copy link
Contributor

Choose a reason for hiding this comment

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

good stuff 😌

Copy link
Member Author

Choose a reason for hiding this comment

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

50% credit goes to AI 😜

@davidtaylorhq davidtaylorhq merged commit 0d58b40 into main Nov 19, 2024
2 checks passed
@davidtaylorhq davidtaylorhq deleted the custom-i18n-rule branch November 19, 2024 13:32
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