From df03a45414292d0bff1018416b2b39cbead77551 Mon Sep 17 00:00:00 2001 From: Tomas Madariaga Date: Thu, 18 Jun 2026 11:49:10 +0200 Subject: [PATCH 1/3] feat(packages/sui-lint): fix RepositoryLinter node_modules ignore for pnpm Co-Authored-By: Claude Opus 4.6 --- packages/sui-lint/src/RepositoryLinter/Runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sui-lint/src/RepositoryLinter/Runner.js b/packages/sui-lint/src/RepositoryLinter/Runner.js index 8c3ffc81f..39e67d6f2 100644 --- a/packages/sui-lint/src/RepositoryLinter/Runner.js +++ b/packages/sui-lint/src/RepositoryLinter/Runner.js @@ -11,7 +11,7 @@ module.exports.Runner = class Runner { } assertion(key) { - const files = this.fg.sync(key, {ignore: ['node_modules'], onlyFiles: false}) ?? [] + const files = this.fg.sync(key, {ignore: ['**/node_modules/**'], onlyFiles: false}) ?? [] return files.map(Match.create) } } From 9b2188f046330146c246e0ddbd8470265fd7030a Mon Sep 17 00:00:00 2001 From: Tomas Madariaga Date: Thu, 18 Jun 2026 12:00:47 +0200 Subject: [PATCH 2/3] fix(packages/sui-lint): handle directories with file extensions in RepositoryLinter Cypress creates screenshot directories named like .js files (e.g. cypress/screenshots/PTA/CategoryPicker.js). Match.create only checked isDirectory when path had no extension, causing EISDIR crash on readFileSync. Now checks isDirectory regardless of extension and returns an empty string for raw content so rules that access match.raw don't crash. Co-Authored-By: Claude Opus 4.6 --- packages/sui-lint/src/RepositoryLinter/Match.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sui-lint/src/RepositoryLinter/Match.js b/packages/sui-lint/src/RepositoryLinter/Match.js index ffb826b85..52f0373ba 100644 --- a/packages/sui-lint/src/RepositoryLinter/Match.js +++ b/packages/sui-lint/src/RepositoryLinter/Match.js @@ -18,8 +18,8 @@ class Match { static create(path) { const ext = extname(path) - if (!ext && CustomFileReader.create().isDirectory(path)) { - return new Match(path, undefined, undefined, true) + if (CustomFileReader.create().isDirectory(path)) { + return new Match(path, undefined, '', true) } let parsed From 981ea14b7ce57db228521b0e8252223c3b793703 Mon Sep 17 00:00:00 2001 From: Tomas Madariaga Date: Thu, 18 Jun 2026 12:27:48 +0200 Subject: [PATCH 3/3] test(packages/sui-lint): add tests for node_modules ignore and directory handling Co-Authored-By: Claude Opus 4.6 --- packages/sui-lint/test/server/MatchSpec.js | 14 ++++++++++++++ packages/sui-lint/test/server/RunnerSpec.js | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/sui-lint/test/server/MatchSpec.js b/packages/sui-lint/test/server/MatchSpec.js index 5db0c60c7..ebd3938fc 100644 --- a/packages/sui-lint/test/server/MatchSpec.js +++ b/packages/sui-lint/test/server/MatchSpec.js @@ -29,6 +29,20 @@ describe('Match', function () { // Then expect(match.isDir).to.be.eqls(true) + expect(match.raw).to.be.eqls('') + }) + + it('Should detect directories with file-like extensions', function () { + // Given + this.isDirStub.returns(true) + + // When + const match = Match.create('cypress/screenshots/PTA/CategoryPicker.js') + + // Then + expect(match.isDir).to.be.eqls(true) + expect(match.raw).to.be.eqls('') + expect(match.raw.match(/pattern/)).to.be.eqls(null) }) it('Should detect files w/out extensions', function () { diff --git a/packages/sui-lint/test/server/RunnerSpec.js b/packages/sui-lint/test/server/RunnerSpec.js index 282c75406..06990d0db 100644 --- a/packages/sui-lint/test/server/RunnerSpec.js +++ b/packages/sui-lint/test/server/RunnerSpec.js @@ -23,4 +23,20 @@ describe('Runner', function () { expect(this.matchCreateStub.firstCall.firstArg).to.be.eql('path/file.json') expect(this.syncStub.firstCall.firstArg).to.be.eql('**/*.json') }) + + it('Should ignore node_modules at any depth', function () { + this.syncStub.returns([]) + + Runner.create({sync: this.syncStub}).assertion('**/*.js') + + expect(this.syncStub.firstCall.args[1].ignore).to.be.eql(['**/node_modules/**']) + }) + + it('Should include directories in results', function () { + this.syncStub.returns(['app/src']) + + Runner.create({sync: this.syncStub}).assertion('app/src') + + expect(this.syncStub.firstCall.args[1].onlyFiles).to.be.eql(false) + }) })