Skip to content

Commit 9b86fae

Browse files
committed
refactor: fix lint 2
1 parent 9d0f9a8 commit 9b86fae

File tree

11 files changed

+28
-16
lines changed

11 files changed

+28
-16
lines changed

eslint.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ export default tseslint.config(
1313
...vitest,
1414
{
1515
settings: {
16-
'import/resolver': { typescript: { project: 'tsconfig.base.json' } },
16+
'import/resolver': {
17+
typescript: {
18+
project: 'tsconfig.base.json',
19+
alwaysTryTypes: true,
20+
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
21+
},
22+
node: {
23+
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
24+
},
25+
},
1726
},
1827
},
1928
{ plugins: { '@nx': nxEslintPlugin } },

packages/plugin-knip/src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Audit, Group } from '@code-pushup/models';
1+
import type { Audit, Group } from '@code-pushup/models';
22

33
export const KNIP_PLUGIN_SLUG = 'knip';
44
export const KNIP_RAW_REPORT_NAME = 'knip-raw-report.json';

packages/plugin-knip/src/lib/knip.plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { join } from 'node:path';
2-
import { PluginConfig } from '@code-pushup/models';
1+
import path from 'node:path';
2+
import type { PluginConfig } from '@code-pushup/models';
33
import { KNIP_AUDITS, KNIP_GROUPS, KNIP_PLUGIN_SLUG } from './constants.js';
44
import { RunnerOptions, createRunnerConfig } from './runner/index.js';
55

66
export type PluginOptions = RunnerOptions;
77

88
export function knipPlugin(options: PluginOptions = {}): PluginConfig {
99
const {
10-
outputFile = join(
10+
outputFile = path.join(
1111
'.code-pushup',
1212
KNIP_PLUGIN_SLUG,
1313
`knip-report-${Date.now()}.json`,

packages/plugin-knip/src/lib/reporter/reporter.int.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('knipReporter', () => {
3535
outputFile: relative(path.join('..', '..', '..', '..', outputFile)),
3636
});
3737

38+
/* eslint-disable-next-line n/no-sync */
3839
execSync(
3940
`npx knip --no-exit-code --reporter=${reporterPath} --reporter-options='${customReporterOptions}'`,
4041
{

packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { MEMFS_VOLUME, osAgnosticPath } from '@code-pushup/test-utils';
22
import { logger } from '@code-pushup/utils';
33
import type { ReporterOptions } from 'knip';
4-
import { IssueRecords, IssueSet } from 'knip/dist/types/issues';
4+
import type { IssueRecords, IssueSet } from 'knip/dist/types/issues';
55
import { fs as memfsFs, vol } from 'memfs';
66
import { beforeEach, describe, expect, it, vi } from 'vitest';
77
import { KNIP_RAW_REPORT_NAME, KNIP_REPORT_NAME } from './constants.js';
88
import { CustomReporterOptions } from './model.js';
99
import { knipReporter } from './reporter.js';
1010
import path from 'node:path';
1111
import { rawReport } from '../../../mocks/fixtures/raw-knip.report';
12-
import { AuditOutputs } from '@code-pushup/models';
12+
import type { AuditOutputs } from '@code-pushup/models';
1313

1414
vi.mock('@code-pushup/utils', async () => {
1515
const actual = await vi.importActual('@code-pushup/utils');

packages/plugin-knip/src/lib/reporter/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
IssueSeverity as KnipSeverity,
88
ReporterOptions,
99
} from 'knip/dist/types/issues';
10-
import {
10+
import type {
1111
AuditOutput,
1212
AuditOutputs,
1313
IssueSeverity as CondPushupIssueSeverity,

packages/plugin-knip/src/lib/reporter/utils.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReporterOptions } from 'knip';
1+
import type { ReporterOptions } from 'knip';
22
import type {
33
IssueRecords,
44
Issue as KnipIssue,
@@ -7,9 +7,9 @@ import type {
77
} from 'knip/dist/types/issues';
88
import { describe, expect, it } from 'vitest';
99
import {
10-
IssueSeverity,
1110
auditDetailsSchema,
1211
auditOutputsSchema,
12+
type IssueSeverity,
1313
} from '@code-pushup/models';
1414
import { ISSUE_RECORDS_TYPES, ISSUE_SET_TYPES } from '../constants.js';
1515
import { ISSUE_TYPE_MESSAGE } from './constants.js';

packages/plugin-knip/src/lib/runner/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'node:path';
2-
import { RunnerConfig } from '@code-pushup/models';
2+
import type { RunnerConfig } from '@code-pushup/models';
33
import {
44
KNIP_PLUGIN_SLUG,
55
KNIP_REPORT_NAME,

packages/plugin-knip/src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CategoryRef } from '@code-pushup/models';
1+
import type { CategoryRef } from '@code-pushup/models';
22
import {
33
KNIP_PLUGIN_SLUG,
44
type KnipAudits,

packages/plugin-knip/tsconfig.test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
66
},
77
"include": [
8-
"vite.config.unit.ts",
9-
"vite.config.integration.ts",
8+
"vitest.int.config.ts",
9+
"vitest.unit.config.ts",
1010
"mocks/**/*.ts",
1111
"src/**/*.test.ts",
1212
"src/**/*.test.tsx",

0 commit comments

Comments
 (0)