Skip to content

Commit b039fa7

Browse files
authored
Replace words (#1214)
1 parent 752a028 commit b039fa7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/rules/no-bare-strings-in-template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ If you want to report these string literals, enable the [vue/no-useless-v-bind]
5757
```js
5858
{
5959
"vue/no-bare-strings-in-template": ["error", {
60-
"whitelist": [
60+
"allowlist": [
6161
"(", ")", ",", ".", "&", "+", "-", "=", "*", "/", "#", "%", "!", "?", ":", "[", "]", "{", "}", "<", ">", "\u00b7", "\u2022", "\u2010", "\u2013", "\u2014", "\u2212", "|"
6262
],
6363
"attributes": {
@@ -70,7 +70,7 @@ If you want to report these string literals, enable the [vue/no-useless-v-bind]
7070
}
7171
```
7272

73-
- `whitelist` ... An array of whitelisted strings.
73+
- `allowlist` ... An array of allowed strings.
7474
- `attributes` ... An object whose keys are tag name or patterns and value is an array of attributes to check for that tag name.
7575
- `directives` ... An array of directive names to check literal value.
7676

docs/rules/require-prop-type-constructor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: require prop type to be a constructor
1414

1515
This rule reports prop types that can't be presumed as constructors.
1616

17-
It's impossible to catch every possible case and know whether the prop type is a constructor or not, hence this rule black list few types of nodes, instead of white-listing correct ones.
17+
It's impossible to catch every possible case and know whether the prop type is a constructor or not, hence this rule block-list few types of nodes, instead of allow-listing correct ones.
1818

1919
The following types are forbidden and will be reported:
2020

lib/rules/no-bare-strings-in-template.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ module.exports = {
128128
{
129129
type: 'object',
130130
properties: {
131-
whitelist: {
131+
allowlist: {
132132
type: 'array',
133133
items: { type: 'string' },
134134
uniqueItems: true
@@ -164,12 +164,12 @@ module.exports = {
164164
*/
165165
const opts = context.options[0] || {}
166166
/** @type {string[]} */
167-
const whitelist = opts.whitelist || DEFAULT_WHITELIST
167+
const allowlist = opts.allowlist || DEFAULT_WHITELIST
168168
const attributes = parseTargetAttrs(opts.attributes || DEFAULT_ATTRIBUTES)
169169
const directives = opts.directives || DEFAULT_DIRECTIVES
170170

171-
const whitelistRe = new RegExp(
172-
whitelist.map((w) => regexp.escape(w)).join('|'),
171+
const allowlistRe = new RegExp(
172+
allowlist.map((w) => regexp.escape(w)).join('|'),
173173
'gu'
174174
)
175175

@@ -180,7 +180,7 @@ module.exports = {
180180
* @param {string} str
181181
*/
182182
function getBareString(str) {
183-
return str.trim().replace(whitelistRe, '').trim()
183+
return str.trim().replace(allowlistRe, '').trim()
184184
}
185185

186186
/**

tests/lib/rules/no-bare-strings-in-template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ tester.run('no-bare-strings-in-template', rule, {
214214
<h1>ipsum</h1>
215215
</template>
216216
`,
217-
options: [{ whitelist: ['Lorem'] }],
217+
options: [{ allowlist: ['Lorem'] }],
218218
errors: [
219219
{
220220
line: 4,

0 commit comments

Comments
 (0)