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

lint: collect unused l10n tokens #25

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

smelukov
Copy link
Member

@smelukov smelukov commented Jun 22, 2017

> basis lint --warn-unused-l10n src --reporter console

  ...

  /src/dealer/app/ui/field/car-body/index.l10n
    * bodyType.caption

  /src/dealer/app/ui/searchResults/list/template/list-item.l10n
    * views

  /src/dealer/app/ui/searchResults/view/module/details/template/view.l10n
    * vehicleType
    * vehicleType.caption
    * vehicleType.newcar
    * vehicleType.usedcar
    * price
    * price.noPrice
    * price.priceCurrency
    * price.priceCurrency.rub
    * price.priceCurrency.usd
    * price.priceCurrency.eur

@smelukov smelukov self-assigned this Jun 22, 2017
if (!tokenNames[tokenName]) {
flow.warn({
file: dictFileName,
message: tokenName
Copy link
Member

Choose a reason for hiding this comment

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

Should be something useful, e.g. Path ${tokenName} is never used

{
var tokenNames = unusedL10nTokens[dictFileName];

dictFileName = dictFileName.slice(process.cwd().length);
Copy link
Member

Choose a reason for hiding this comment

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

require('path').relative(process.cwd(), dictFileName)?
FileName -> Filename

});
}

tasks.push(task);
Copy link
Member

Choose a reason for hiding this comment

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

tasks.push({
  name: 'unused l10n tokens at ' + dictFileName,
  warnings: Object.keys(tokenNames).map(function(name) {
    return { file: name };
  })
})

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

Successfully merging this pull request may close these issues.

2 participants