Skip to content

Commit

Permalink
fix(lint): Compute lint root correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jan 29, 2023
1 parent d6c9ccd commit 7e2500d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/config/nr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export default (userConfig?: ConfigurationFactory): ConfigurationFactory => asyn
format: 'codeframe'
};

const lintRoot = srcDir ?? process.cwd();
// We need to use || here because srcDir may be an empty string, in which case
// we want to fall back to process.cwd(), and this will not happen with ??
// because empty strings are not considered nullish.
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const lintRoot = srcDir || process.cwd();

command('eslint', ['eslint', [lintRoot], eslintFlags]);

Expand Down
4 changes: 4 additions & 0 deletions src/etc/vitest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import {
expect
} from 'vitest';

// This tests that Vitest works with our configured path mappings.
import log from 'lib/log';


describe('Vitest', () => {
it('should initialize and run test files.', () => {
expect(log).toHaveProperty('info');
expect(true).toEqual(true);
});
});

0 comments on commit 7e2500d

Please sign in to comment.