Skip to content

Commit

Permalink
fix: lint import extensions and fix missing .js extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Dec 17, 2024
1 parent 284f755 commit 9d6eacf
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ export default tseslint.config(
files: ['**/*.json'],
languageOptions: { parser: jsoncParser },
},
{
files: ['**/*.ts', '**/*.js'],
rules: {
'n/file-extension-in-import': ['error', 'always'],
},
},
{
files: ['**/perf/**/*.ts'],
rules: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import type {
RunnerConfig,
} from '@code-pushup/models';
import { readJsonFile, removeDirectoryIfExists } from '@code-pushup/utils';
import { createRunnerConfig, executeRunner } from '.';
import type { FinalCoveragePluginConfig } from '../config.js';
import {
PLUGIN_CONFIG_PATH,
RUNNER_OUTPUT_PATH,
WORKDIR,
} from './constants.js';
import { createRunnerConfig, executeRunner } from './index.js';

describe('createRunnerConfig', () => {
it('should create a valid runner config', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-js-packages/src/lib/js-packages-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
dependencyGroups,
} from './config.js';
import { dependencyDocs, dependencyGroupWeights } from './constants.js';
import { packageManagers } from './package-managers/package-managers';
import { packageManagers } from './package-managers/package-managers.js';
import { createRunnerConfig } from './runner/index.js';
import { normalizeConfig } from './utils.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { describe, expect, it } from 'vitest';
import type { RunnerConfig } from '@code-pushup/models';
import { readJsonFile, removeDirectoryIfExists } from '@code-pushup/utils';
import { createRunnerConfig } from '.';
import type { FinalJSPackagesPluginConfig } from '../config.js';
import { defaultAuditLevelMapping } from '../constants.js';
import { PLUGIN_CONFIG_PATH, WORKDIR } from './constants.js';
import { createRunnerConfig } from './index.js';

describe('createRunnerConfig', () => {
it('should create a valid runner config', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-lighthouse/src/lib/normalize-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { bold, yellow } from 'ansis';
import { ui } from '@code-pushup/utils';
import { LIGHTHOUSE_PLUGIN_SLUG } from './constants.js';
import { DEFAULT_CLI_FLAGS } from './runner/constants.js';
import type { LighthouseCliFlags } from './runner/types';
import type { LighthouseCliFlags } from './runner/types.js';
import type { LighthouseOptions } from './types.js';

const { onlyCategories, ...originalDefaultCliFlags } = DEFAULT_CLI_FLAGS;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-lighthouse/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Audit, CategoryRef, Group } from '@code-pushup/models';
import { filterItemRefsBy, toArray } from '@code-pushup/utils';
import { LIGHTHOUSE_PLUGIN_SLUG } from './constants.js';
import type { LighthouseCliFlags } from './runner/types';
import type { LighthouseCliFlags } from './runner/types.js';

export type LighthouseGroupSlugs =
| 'performance'
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/lib/zod-validation.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatErrorPath } from './zod-validation';
import { formatErrorPath } from './zod-validation.js';

describe('formatErrorPath', () => {
it.each([
Expand Down

0 comments on commit 9d6eacf

Please sign in to comment.