npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@feedbackfruits/eslint-plugin-ember

v0.8.0

Published

Custom ESLint rules for usage in FeedbackFruits ember repositories

Downloads

89

Readme

eslint-plugin-ember

Custom ESLint rules for usage in FeedbackFruits ember repositories

translations-no-partial-sentence-options

Translators prefer to treat translations with options (plural, select) completely separately. So, when possible, such translations should be broken up on sentence level, rather than halfway in a sentence to avoid duplication.

Example of incorrect code for this rule:

show-comments: 'Show {count, plural, =1 {comment} other {comments}}'

Example of correct code for this rule:

show-comments: '{count, plural, =1 {Show comment} other {Show comments}}'

In case there are options with only trailing whitespaces around it, you can say those whitespaces are partial sentences. However, we already have the translations-no-trailing-whitespaces rule to fix this, so we don't treat such whitespaces as violating partial sentences.

translations-no-trailing-whitespaces

Sometimes you have translations that appear correct, but do have whitespaces around the variable for formatting reasons. It's unpredictable whether those whitespaces will end up correctly on the page or not, so it's recommended to remove them.

Example of incorrect code:

show-comments-or-reviews: '{ showComments, select,
                  true { { count, plural, =1 {Show comment} other {Show comments} }}
                  other { { count, plural, =1 {Show review} other {Show reviews}} }}'
show-comments: { count, plural, =1 { Show comment } other { Show comments }}

Example of correct code:

show-comments-or-reviews: '{ showComments, select,
                  true {{ count, plural, =1 {Show comment} other {Show comments}}}
                  other {{ count, plural, =1 {Show review} other {Show reviews}}}}'
show-comments: { count, plural, =1 {Show comment} other {Show comments}}

This rule can fix the violations for you. Do keep in mind that removing the trailing whitespaces does not always give the result that you want. Therefore, this rule only provides suggestions to fix the translations, so that a lint --fix won't change the translation automatically. For example, fixing this translation:

title: Read{reflect, select, true { and reflect} other {}}

will become:

title: Read{reflect, select, true {and reflect} other {}}

which results in wrong translations. Instead, it's better to break this down on sentence level:

title: '{reflect, select, true {Read and reflect} other {Read}}'

, or even better, split them up into separate translations:

title-reflect: Read and reflect
title: Read

Note that translations defined with | or > can be fixed, but change the formatting. It's recommended to use the suggested fix if you can't find the trailing whitespace yourself. To avoid this entirely, it's usually even better to think of simplifying / splitting up the translation, as a | or > is often an indication that the translation is too complex.