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

Apply rule against root-level strings #9

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jan 12, 2024

Hello! Thanks for this handy lint rule. I noticed it wasn't working for raw strings at the root level. I made a chance and added a test. Hope this works, let me know if you'd like any changes.

Copy link

changeset-bot bot commented Jan 12, 2024

🦋 Changeset detected

Latest commit: 7ee3f3a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -111,7 +111,7 @@ function checkSvelteLiteralOrText(
const loc = literal.loc!
context.report({
loc,
message: `raw text '${literal.value}' is used`
message: `raw text '${literal.value.trimStart().trimEnd()}' is used`
Copy link
Author

Choose a reason for hiding this comment

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

I thought this would help with cleaning up the whitespace so the error message was relevant.

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you fro this PR!

lib/rules/no-raw-text.ts Outdated Show resolved Hide resolved
lib/rules/no-raw-text.ts Outdated Show resolved Hide resolved
ota-meshi and others added 3 commits January 13, 2024 15:52
Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
@ghost ghost requested a review from ota-meshi January 16, 2024 15:15
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@ota-meshi ota-meshi merged commit a311f0e into intlify:main Jan 16, 2024
6 checks passed
@ghost
Copy link
Author

ghost commented Jan 16, 2024

Thanks for being so quick with the review. When you get a chance can you publish a new version of the package to npm? Thanks again!

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.

1 participant