Skip to content

Commit

Permalink
Fix scoped package identification (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeTechGuy committed Feb 8, 2024
1 parent 9953c13 commit 7d3f7d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.yalc
lib
node_modules
dist
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const eslintPlugins = fs
.filter(
(plugin) =>
(plugin.startsWith('eslint-plugin') ||
(plugin.startsWith('@') && /eslint/u.test(plugin))) &&
plugin.startsWith('@')) &&
plugin !== 'eslint-plugin-disable-autofix' &&
plugin !== '@eslint',
);
Expand All @@ -93,7 +93,7 @@ for (const plugin of eslintPlugins) {
if (plugin.includes('@')) {
const pluginDirectories = fs
.readdirSync(path.join(dirname, nodeModules, plugin))
.filter((read) => /plugin/u.test(read));
.filter((read) => read.startsWith("eslint-plugin"));
for (const pluginDirectory of pluginDirectories) {
const scopedPlugin = path.posix.join(plugin, pluginDirectory);
const importedPlugin = require(scopedPlugin) as EslintPlugin;
Expand Down

0 comments on commit 7d3f7d4

Please sign in to comment.