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

Default property value on m6web-i18n/no-text-as-attribute #13

Open
josemiguelmelo opened this issue Jan 8, 2020 · 1 comment · May be fixed by #14
Open

Default property value on m6web-i18n/no-text-as-attribute #13

josemiguelmelo opened this issue Jan 8, 2020 · 1 comment · May be fixed by #14
Assignees
Labels

Comments

@josemiguelmelo
Copy link

Hey 🙂

When using the rule m6web-i18n/no-text-as-attribute without attributes property, eslint throws this expection:

TypeError: Cannot read property 'forEach' of undefined
Occurred while linting /src/src/example.js:22
    at JSXAttribute (/node_modules/eslint-plugin-m6web-i18n/lib/rules/no-text-as-attribute.js:33:20)
    at /node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)
    at /node_modules/eslint/lib/linter/linter.js:936:32
    at Array.forEach (<anonymous>) {

Is this property required? Does it have any default value?

@flepretre
Copy link
Collaborator

Hi 👋

This property is indeed required, the rule will validate that you don't have any untranslated text in the attributes lits you provide in the config.

I'll fix this error but, I thing the solution you're looking for is to disable the rule.

If you don't want to verify any attributes then the rule is useless to you and should be deactivated this way

"m6web-i18n/no-text-as-attribute": "off"

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