Skip to content

Commit ce3df34

Browse files
committedMay 1, 2020
Update code for latest linting rules from xo.
1 parent ea431a3 commit ce3df34

File tree

7 files changed

+115
-115
lines changed

7 files changed

+115
-115
lines changed
 

‎markdownlint.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function readConfiguration(args) {
4141
const projectConfig = markdownlint.readConfigSync(projectConfigFile, configFileParsers);
4242
config = extend(config, projectConfig);
4343
break;
44-
} catch (error) {
44+
} catch (_) {
4545
// Ignore failure
4646
}
4747
}
@@ -90,7 +90,7 @@ function prepareFileList(files, fileExtensions, previousResults) {
9090

9191
return glob.sync(path.join(file, '**', extensionGlobPart), globOptions);
9292
}
93-
} catch (error) {
93+
} catch (_) {
9494
// Not a directory, not a file, may be a glob
9595
if (previousResults) {
9696
const matcher = new minimatch.Minimatch(path.resolve(process.cwd(), file), globOptions);
@@ -197,7 +197,7 @@ function tryResolvePath(filepath) {
197197

198198
// Maybe it is a path to package installed locally
199199
return require.resolve(path.join(process.cwd(), filepath));
200-
} catch (error) {
200+
} catch (_) {
201201
return filepath;
202202
}
203203
}
@@ -236,7 +236,7 @@ if (existsSync(ignorePath)) {
236236
}
237237

238238
const files = prepareFileList(program.args, ['md', 'markdown'])
239-
.filter(ignoreFilter);
239+
.filter(value => ignoreFilter(value));
240240
const ignores = prepareFileList(program.ignore, ['md', 'markdown'], files);
241241
const customRules = loadCustomRules(program.rules);
242242
const diff = differenceWith(files, ignores, function (a, b) {

‎test/custom-rules/files/test-rule-1.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
names: ['test-rule-1'],
33
description: 'Test rule broken',
44
tags: ['test'],
5-
function: (params, onError) => {
5+
function: (parameters, onError) => {
66
onError({
77
lineNumber: 1
88
});

‎test/custom-rules/files/test-rule-2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
names: ['test-rule-2'],
33
description: 'Test rule 2 broken',
44
tags: ['test'],
5-
function: (params, onError) => {
5+
function: (parameters, onError) => {
66
onError({
77
lineNumber: 1
88
});

‎test/custom-rules/files/test-rule-3-4.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = [
33
names: ['test-rule-3'],
44
description: 'Test rule 3 broken',
55
tags: ['test'],
6-
function: (params, onError) => {
6+
function: (parameters, onError) => {
77
onError({
88
lineNumber: 1
99
});
@@ -13,7 +13,7 @@ module.exports = [
1313
names: ['test-rule-4'],
1414
description: 'Test rule 4 broken',
1515
tags: ['test'],
16-
function: (params, onError) => {
16+
function: (parameters, onError) => {
1717
onError({
1818
lineNumber: 1
1919
});

‎test/custom-rules/test-rule-package-other/rule.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
names: ['test-rule-package-other'],
33
description: 'Test rule package other broken',
44
tags: ['test'],
5-
function: (params, onError) => {
5+
function: (parameters, onError) => {
66
onError({
77
lineNumber: 1
88
});

‎test/custom-rules/test-rule-package/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
names: ['test-rule-package'],
33
description: 'Test rule package broken',
44
tags: ['test'],
5-
function: (params, onError) => {
5+
function: (parameters, onError) => {
66
onError({
77
lineNumber: 1
88
});

‎test/test.js

+105-105
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.