@@ -134,6 +134,17 @@ export default {
134
134
"@intlify/vue-i18n/no-raw-text" : [
135
135
" error" ,
136
136
{
137
+ "attributes" : {
138
+ "/.+/" : [
139
+ " title" ,
140
+ " aria-label" ,
141
+ " aria-placeholder" ,
142
+ " aria-roledescription" ,
143
+ " aria-valuetext"
144
+ ],
145
+ "input" : [" placeholder" ],
146
+ "img" : [" alt" ]
147
+ },
137
148
"ignoreNodes" : [" md-icon" , " v-icon" ],
138
149
"ignorePattern" : " ^[-#:()&]+$" ,
139
150
"ignoreText" : [" EUR" , " HKD" , " USD" ]
@@ -142,9 +153,47 @@ export default {
142
153
}
143
154
```
144
155
145
- - ` ignoreNodes ` : specify nodes to ignore such as icon components
146
- - ` ignorePattern ` : specify a regexp pattern that matches strings to ignore
147
- - ` ignoreText ` : specify an array of strings to ignore
156
+ - ` attributes ` : An object whose keys are tag name or patterns and value is an array of attributes to check for that tag name. Default empty.
157
+ - ` ignoreNodes ` : specify nodes to ignore such as icon components. Default empty.
158
+ - ` ignorePattern ` : specify a regexp pattern that matches strings to ignore. Default none.
159
+ - ` ignoreText ` : specify an array of strings to ignore. Default empty.
160
+
161
+ ### ` attributes `
162
+
163
+ <eslint-code-block >
164
+
165
+ <!-- eslint-skip -->
166
+
167
+ ``` vue
168
+ <script>
169
+ /* eslint @intlify/vue-i18n/no-raw-text: ['error', {attributes: { '/.+/': ['label'] }}] */
170
+ </script>
171
+ <template>
172
+ <!-- ✗ BAD -->
173
+ <my-input label="hello" />
174
+ <any-component label="hello" />
175
+ </template>
176
+ ```
177
+
178
+ </eslint-code-block >
179
+
180
+ <eslint-code-block >
181
+
182
+ <!-- eslint-skip -->
183
+
184
+ ``` vue
185
+ <script>
186
+ /* eslint @intlify/vue-i18n/no-raw-text: ['error', {attributes: { 'MyInput': ['label'] }}] */
187
+ </script>
188
+ <template>
189
+ <!-- ✗ BAD -->
190
+ <my-input label="hello" />
191
+ <!-- ✓ GOOD -->
192
+ <other-component label="hello" />
193
+ </template>
194
+ ```
195
+
196
+ </eslint-code-block >
148
197
149
198
## :rocket : Version
150
199
0 commit comments