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

Commit

Permalink
10.0.1
Browse files Browse the repository at this point in the history
Fix #8: stylelint error after a clean global install.

Possibly, this also fixes a more general problem with the "extends"
property of stylelint configs.
  • Loading branch information
EvgenyOrekhov committed Dec 4, 2016
1 parent cc7db73 commit 72a95bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lints",
"version": "10.0.0",
"version": "10.0.1",
"description": "Lint all your JavaScript, CSS, HTML and Markdown with a single command",
"keywords": [
"lint",
Expand Down
19 changes: 17 additions & 2 deletions src/linters/stylelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ const stylelint = require("stylelint");
const linterName = "stylelint";

function lintAndLogWarnings(settings) {
function buildOptions() {
if (settings.options.extends === undefined) {
return settings.options;
}

return Object.assign(
{},
settings.options,
{
extends: typeof settings.options.extends === "string"
? require.resolve(settings.options.extends)
: settings.options.extends.map(require.resolve)
}
);
}
function logWarnings(result) {
settings.logWarnings(result.results[0].warnings);
}

const options = settings.options === undefined
? {"extends": "stylelint-config-standard"}
: settings.options;
? {"extends": require.resolve("stylelint-config-standard")}
: buildOptions();

return stylelint
.lint({
Expand Down

0 comments on commit 72a95bd

Please sign in to comment.