Skip to content

Commit

Permalink
Refactor to remove slash package (#5544)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Sep 17, 2021
1 parent 6f6353b commit 9608544
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/augmentConfig.js
Expand Up @@ -5,8 +5,8 @@ const getModulePath = require('./utils/getModulePath');
const globjoin = require('globjoin');
const micromatch = require('micromatch');
const normalizeAllRuleSettings = require('./normalizeAllRuleSettings');
const normalizePath = require('normalize-path');
const path = require('path');
const slash = require('slash');

/** @typedef {import('stylelint').StylelintConfigPlugins} StylelintConfigPlugins */
/** @typedef {import('stylelint').StylelintConfigProcessor} StylelintConfigProcessor */
Expand Down Expand Up @@ -427,7 +427,7 @@ function applyOverrides(fullConfig, configDir, filePath) {
return globjoin(configDir, glob);
})
// Glob patterns for micromatch should be in POSIX-style
.map(slash);
.map((s) => normalizePath(s));

if (micromatch.isMatch(filePath, filesGlobs)) {
config = mergeConfigs(config, configOverrides);
Expand Down
6 changes: 4 additions & 2 deletions lib/isPathIgnored.js
Expand Up @@ -3,8 +3,8 @@
const filterFilePaths = require('./utils/filterFilePaths');
const getFileIgnorer = require('./utils/getFileIgnorer');
const micromatch = require('micromatch');
const normalizePath = require('normalize-path');
const path = require('path');
const slash = require('slash');

/**
* To find out if a path is ignored, we need to load the config,
Expand All @@ -28,7 +28,9 @@ module.exports = function isPathIgnored(stylelint, filePath) {
}

// Glob patterns for micromatch should be in POSIX-style
const ignoreFiles = /** @type {Array<string>} */ (result.config.ignoreFiles || []).map(slash);
const ignoreFiles = /** @type {Array<string>} */ (result.config.ignoreFiles || []).map((s) =>
normalizePath(s),
);

const absoluteFilePath = path.isAbsolute(filePath)
? filePath
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -141,7 +141,6 @@
"postcss-selector-parser": "^6.0.6",
"postcss-value-parser": "^4.1.0",
"resolve-from": "^5.0.0",
"slash": "^3.0.0",
"specificity": "^0.4.1",
"string-width": "^4.2.2",
"strip-ansi": "^6.0.0",
Expand Down

0 comments on commit 9608544

Please sign in to comment.