Skip to content

vue/no-bare-strings-in-template "allowlist" not always taken into account #2681

Closed
@fabienmacko

Description

@fabienmacko

Hello,

My .eslintrc.cjs config file explicitly set an "allowlist" for the rule "vue/no-bare-strings-in-template". Those are Google Icons.

For some reasons it's working for most of them, but "edit_note" trigger an error even tho I add it to the allowlist as you can see below.

When I run yarn lint --fix i'm getting:

  104:57  error  Unexpected non-translated string used  vue/no-bare-strings-in-template

As a workaround I did {{ 'edit_note' }} but looks weired.
What could cause this error ? Is it a bug or a mistake in my usage ?

.eslintrc.cjs

'vue/no-bare-strings-in-template': [
            'error',
            {
                allowlist: [
                    '(',
                    ')',
                    ',',
                    '.',
                    '&',
                    '+',
                    '-',
                    '=',
                    '*',
                    '/',
                    '#',
                    '%',
                    '!',
                    '?',
                    ':',
                    '[',
                    ']',
                    '{',
                    '}',
                    '<',
                    '>',
                    '\u00b7',
                    '\u2022',
                    '\u2010',
                    '\u2013',
                    '\u2014',
                    '\u2212',
                    '|',
                    //Allow all google icons
                    'waving_hand',
                    'check_circle',
                    'error',
                    'arrow_drop_up',
                    'arrow_drop_down',
                    'visibility',
                    'edit',
                    'content_copy',
                    'archive',
                    'unarchive',
                    'publish',
                    'arrow_back_ios',
                    'keyboard_arrow_down',
                    'delete',
                    'arrow_upward',
                    'arrow_downward',
                    'edit_note',
                    'close',
                ],
                attributes: {
                    '/.+/': ['title', 'aria-label', 'aria-placeholder', 'aria-roledescription', 'aria-valuetext'],
                    input: ['placeholder'],
                    img: ['alt'],
                },
                directives: ['v-text'],
            },
        ],
Usage in the code

<span class="material-symbols-outlined">edit_note</span>
                                           ^^^^^^^^ Trigger the error

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions