Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 72a95bd

Browse files
committed
10.0.1
Fix #8: stylelint error after a clean global install. Possibly, this also fixes a more general problem with the "extends" property of stylelint configs.
1 parent cc7db73 commit 72a95bd

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lints",
3-
"version": "10.0.0",
3+
"version": "10.0.1",
44
"description": "Lint all your JavaScript, CSS, HTML and Markdown with a single command",
55
"keywords": [
66
"lint",

src/linters/stylelint.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,28 @@ const stylelint = require("stylelint");
88
const linterName = "stylelint";
99

1010
function lintAndLogWarnings(settings) {
11+
function buildOptions() {
12+
if (settings.options.extends === undefined) {
13+
return settings.options;
14+
}
15+
16+
return Object.assign(
17+
{},
18+
settings.options,
19+
{
20+
extends: typeof settings.options.extends === "string"
21+
? require.resolve(settings.options.extends)
22+
: settings.options.extends.map(require.resolve)
23+
}
24+
);
25+
}
1126
function logWarnings(result) {
1227
settings.logWarnings(result.results[0].warnings);
1328
}
1429

1530
const options = settings.options === undefined
16-
? {"extends": "stylelint-config-standard"}
17-
: settings.options;
31+
? {"extends": require.resolve("stylelint-config-standard")}
32+
: buildOptions();
1833

1934
return stylelint
2035
.lint({

0 commit comments

Comments
 (0)