Skip to content

Commit 6d794a7

Browse files
committed
Disable import/no-cycle rule to save linting time
1 parent 52e1a67 commit 6d794a7

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.github/actions/src/info/__tests__/index.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import { getAllPackages, getRawPackages } from '../index.js';
77

88
const mockedCheckChanges = vi.spyOn(git, 'checkForChanges');
99

10+
vi.mock(import('path'), async importOriginal => {
11+
const { posix } = await importOriginal();
12+
13+
return {
14+
default: posix,
15+
posix,
16+
};
17+
});
18+
1019
class NodeError extends Error {
1120
constructor(public readonly code: string) {
1221
super();

eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ export default tseslint.config(
226226
rules: {
227227
'import/first': 'warn',
228228
'import/newline-after-import': 'warn',
229-
'import/no-cycle': 'error',
229+
// This rule is very time intensive.
230+
// 'import/no-cycle': 'error',
230231
'import/no-duplicates': ['warn', { 'prefer-inline': false }],
231232
'import/no-useless-path-segments': 'error',
232233
'import/order': [

lib/vitest-reporter/src/__tests__/coverage.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import fs from 'fs';
22
import { describe, expect, it as baseIt, vi } from 'vitest';
3-
import reporter from '../coverage-reporter.cjs'
3+
import reporter from '../coverage-reporter.cjs';
44

55
// I really don't know why importing from a CJS module doesn't work here
66
// so that's why this line is here
7-
const CoverageReporter = reporter as any
7+
const CoverageReporter = reporter as any;
88

99
vi.spyOn(fs, 'createWriteStream').mockReturnValue({
1010
write: () => true,
@@ -34,7 +34,7 @@ describe(CoverageReporter, () => {
3434
});
3535

3636
it.skipIf(!!process.env.GITHUB_STEP_SUMMARY)('doesn\'t open the summary file if GITHUB_STEP_SUMMARY isn\'t defined', ({ reporter }) => {
37-
reporter.onStart({} as any, { watermarks: {} } as any);
38-
expect(fs.createWriteStream).not.toHaveBeenCalled();
37+
reporter.onStart({} as any, { watermarks: {} } as any);
38+
expect(fs.createWriteStream).not.toHaveBeenCalled();
3939
});
4040
});

lib/vitest-reporter/src/coverage-reporter.cts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
// This is some weird typescript only syntax that allows us to continue to have
99
// the type information even though we're using CJS imports
10-
import fs = require('fs')
11-
import report = require('istanbul-lib-report');
10+
import fs = require('fs');
1211
import type { CoverageSummary } from 'istanbul-lib-coverage';
12+
import report = require('istanbul-lib-report');
1313

1414
/**
1515
* Determines if the coverage summary has full coverage

0 commit comments

Comments
 (0)