Skip to content

Commit 29859db

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
chore(package): update xo to version 0.28.0
1 parent 2a09f7d commit 29859db

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

index.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const {hasOwnProperty} = Object.prototype;
1010
/* eslint prefer-named-capture-group: "off" */
1111

1212
const FENCE_BLOCK_REGEXP = /^(([ \t]*`{3,4})([^\n]*)([\s\S]+?)(^[ \t]*\2))/gm;
13-
const CODE_BLOCK_REGEXP = /(`(?![\\]))((?:.(?!\1(?![\\])))*.?)\1/g;
13+
const CODE_BLOCK_REGEXP = /(`(?!\\))((?:.(?!\1(?!\\)))*.?)\1/g;
1414
const HTML_CODE_BLOCK_REGEXP = /(<code)+?((?!(<code|<\/code>)+?)[\S\s])*(<\/code>)+?/gim;
1515
const LEADING_TRAILING_SLASH_REGEXP = /^\/?([^/]+(?:\/[^/]+)*)\/?$/;
1616
const TRAILING_SLASH_REGEXP = /\/?$/;
1717

18-
function inverse(str) {
19-
return str
18+
function inverse(string) {
19+
return string
2020
.split('')
2121
.reverse()
2222
.join('');
@@ -37,8 +37,8 @@ function addTrailingSlash(value) {
3737
return value.replace(TRAILING_SLASH_REGEXP, '/');
3838
}
3939

40-
function includesIgnoreCase(arr, value) {
41-
return arr.findIndex(val => val.toUpperCase() === value.toUpperCase()) > -1;
40+
function includesIgnoreCase(array, value) {
41+
return array.findIndex(arrayValue => arrayValue.toUpperCase() === value.toUpperCase()) > -1;
4242
}
4343

4444
function buildMentionsRegexp({mentionsPrefixes}) {
@@ -53,11 +53,11 @@ function buildRefRegexp({actions, delimiters, issuePrefixes, issueURLSegments, h
5353
}((?:(?:[\\w-\\.]+)\\/)+(?:[\\w-\\.]+))?(${join([...issuePrefixes, ...issueURLSegments])})(\\d+)(?!\\w)`;
5454
}
5555

56-
function buildRegexp(opts) {
56+
function buildRegexp(options) {
5757
return new RegExp(
58-
opts.mentionsPrefixes.length > 0
59-
? `(?:${buildRefRegexp(opts)}|${buildMentionsRegexp(opts)})`
60-
: buildMentionsRegexp(opts),
58+
options.mentionsPrefixes.length > 0
59+
? `(?:${buildRefRegexp(options)}|${buildMentionsRegexp(options)})`
60+
: buildMentionsRegexp(options),
6161
'gim'
6262
);
6363
}
@@ -122,24 +122,24 @@ function typeError(parentOpt, opt) {
122122
);
123123
}
124124

125-
function normalize(opts, parentOpt) {
126-
for (const opt of Object.keys(opts)) {
125+
function normalize(options, parentOpt) {
126+
for (const opt of Object.keys(options)) {
127127
if (!parentOpt && opt === 'actions') {
128-
normalize(opts[opt], opt);
128+
normalize(options[opt], opt);
129129
} else {
130-
if (!opts[opt]) {
131-
opts[opt] = [];
132-
} else if (isString(opts[opt])) {
133-
opts[opt] = [opts[opt]];
134-
} else if (!Array.isArray(opts[opt])) {
130+
if (!options[opt]) {
131+
options[opt] = [];
132+
} else if (isString(options[opt])) {
133+
options[opt] = [options[opt]];
134+
} else if (!Array.isArray(options[opt])) {
135135
throw typeError(parentOpt, opt);
136136
}
137137

138-
if (opts[opt].length !== 0 && !opts[opt].every(opt => isString(opt))) {
138+
if (options[opt].length !== 0 && !options[opt].every(opt => isString(opt))) {
139139
throw typeError(parentOpt, opt);
140140
}
141141

142-
opts[opt] = opts[opt].filter(Boolean);
142+
options[opt] = options[opt].filter(Boolean);
143143
}
144144
}
145145
}
@@ -165,27 +165,27 @@ module.exports = (options = 'default', overrides = {}) => {
165165

166166
options = isString(options) ? hostConfig[options.toLowerCase()] : options;
167167

168-
const opts = {
168+
const mergedOptions = {
169169
...hostConfig.default,
170170
...options,
171171
...overrides,
172172
actions: {...hostConfig.default.actions, ...options.actions, ...overrides.actions},
173173
};
174174

175-
normalize(opts);
175+
normalize(mergedOptions);
176176

177-
opts.hosts = opts.hosts.map(addTrailingSlash);
178-
opts.issueURLSegments = opts.issueURLSegments.map(addLeadingAndTrailingSlash);
177+
mergedOptions.hosts = mergedOptions.hosts.map(addTrailingSlash);
178+
mergedOptions.issueURLSegments = mergedOptions.issueURLSegments.map(addLeadingAndTrailingSlash);
179179

180-
const regexp = buildRegexp(opts);
181-
const mentionRegexp = buildMentionRegexp(opts);
180+
const regexp = buildRegexp(mergedOptions);
181+
const mentionRegexp = buildMentionRegexp(mergedOptions);
182182

183183
return text => {
184184
if (!isString(text)) {
185185
throw new TypeError('The issue text must be a String');
186186
}
187187

188-
const results = parse(text, regexp, mentionRegexp, opts);
188+
const results = parse(text, regexp, mentionRegexp, mergedOptions);
189189

190190
Reflect.defineProperty(results, 'allRefs', {
191191
get() {

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"codecov": "^3.0.0",
2424
"nyc": "^15.0.0",
2525
"semantic-release": "^17.0.0",
26-
"xo": "^0.27.0"
26+
"xo": "^0.28.0"
2727
},
2828
"engines": {
2929
"node": ">=10.13"
@@ -80,6 +80,9 @@
8080
"test": "xo && nyc ava -v"
8181
},
8282
"xo": {
83-
"prettier": true
83+
"prettier": true,
84+
"rules": {
85+
"unicorn/string-content": "off"
86+
}
8487
}
8588
}

0 commit comments

Comments
 (0)