BedrockStreaming / eslint-plugin-m6web-i18n

ESLint plugin for i18n

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

josemiguelmelo opened this issue · comments

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?

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"