Closed ersachin3112 closed 1 year ago
The following patch should work:
diff --git a/src/index.js b/src/index.js
index 0192bef..a4bb5c9 100644
--- a/src/index.js
+++ b/src/index.js
@@ -3,6 +3,9 @@ const { isAbsolute, join } = require('path');
const globby = require('globby');
const { isMatch } = require('micromatch');
+// @ts-expect-error
+const isPathIgnored = require('stylelint/lib/isPathIgnored');
+
const { getOptions } = require('./options');
const linter = require('./linter');
const { arrify, parseFiles, parseFoldersToGlobs } = require('./utils');
@@ -127,7 +130,7 @@ class StylelintWebpackPlugin {
: globby.sync(wanted, { dot: true, ignore: exclude })
).map(async (file) => {
try {
- return (await api.isPathIgnored(file)) ? false : file;
+ return (await isPathIgnored(api, file)) ? false : file;
} catch (e) {
return file;
}
But note that isPathIgnored
is internal and may change in future releases.
@ybiquitous Sounds like it is good candidate to be public, because when we handle graph, we need to have API to undestand that the file was ignored
@alexander-akait I have no objections now. Could you please open an issue?
@ricardogobbosouza let's refactor our code to avoid breaking change using addional guards like typeof require('stylelint/lib/isPathIgnored') ? ... : ...
, so we will still support old and new versions
I was already working on it, remembering that the stylelint path can be changed.
I just think this stylelint internal change should be a major release
Yeah, I write about it, as minimum they should be marked as internal (_
or @internal
)
This PR contains a:
Motivation / Use-Case
update dependencies to the latest version
Breaking Changes
No
Additional Info
No