Skip to content

Commit

Permalink
devops: stylelint extends are now absolute paths
Browse files Browse the repository at this point in the history
apparently stylelint needs absolute paths for extends and plugins.

refs: 
1. https://stackoverflow.com/a/57840591/6301627
1. AtomLinter/linter-stylelint#68 (comment)
  • Loading branch information
starikcetin committed Feb 28, 2021
1 parent 1f9c4a3 commit 2365e29
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions frontend/stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const rootNodeModulesPath = require('path').resolve(
__dirname,
'..',
'node_modules'
);

const getAbsolutePath = (name) => `${rootNodeModulesPath}/${name}`;

const extendsNames = [
'stylelint-config-standard',
'stylelint-config-sass-guidelines',
'stylelint-config-recess-order',
];

const extendsPaths = extendsNames.map(getAbsolutePath);

module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-sass-guidelines',
'stylelint-config-recess-order',
],
extends: extendsPaths,
plugins: [],
rules: {
'order/properties-alphabetical-order': null, // conflicts with recess-order
Expand Down

0 comments on commit 2365e29

Please sign in to comment.