Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary extension #6361

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest';

import { isValidIPAddress } from '../is-valid-ip-address.js';
import { isValidIPAddress } from '../is-valid-ip-address';

describe('isValidIpAddress', () => {
test('should return true for valid IP address', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/common/env/src/global.ts
Expand Up @@ -2,8 +2,8 @@
import { assertEquals } from '@blocksuite/global/utils';
import { z } from 'zod';

import { isDesktop, isServer } from './constant.js';
import { UaHelper } from './ua-helper.js';
import { isDesktop, isServer } from './constant';

Check failure on line 5 in packages/common/env/src/global.ts

View workflow job for this annotation

GitHub Actions / Lint

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './constant.js'?

Check failure on line 5 in packages/common/env/src/global.ts

View workflow job for this annotation

GitHub Actions / Lint

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './constant.js'?
import { UaHelper } from './ua-helper';

Check failure on line 6 in packages/common/env/src/global.ts

View workflow job for this annotation

GitHub Actions / Lint

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './ua-helper.js'?

Check failure on line 6 in packages/common/env/src/global.ts

View workflow job for this annotation

GitHub Actions / Lint

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './ua-helper.js'?

export const runtimeFlagsSchema = z.object({
enableTestProperties: z.boolean(),
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/__tests__/migration.spec.ts
Expand Up @@ -6,7 +6,7 @@ import { describe, expect, test } from 'vitest';
import type { Array as YArray, Map as YMap } from 'yjs';
import { applyUpdate, Doc } from 'yjs';

import { migrateToSubdoc } from '../blocksuite/index.js';
import { migrateToSubdoc } from '../blocksuite/index';

const fixturePath = resolve(
dirname(fileURLToPath(import.meta.url)),
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/initialization/middleware.ts
Expand Up @@ -7,7 +7,7 @@ import type {
DatabaseBlockModel,
ListBlockModel,
ParagraphBlockModel,
} from '@blocksuite/blocks/dist/models.js';
} from '@blocksuite/blocks/dist/models';
import { assertExists } from '@blocksuite/global/utils';
import type { DeltaOperation, JobMiddleware } from '@blocksuite/store';

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/electron/forge.config.mjs
Expand Up @@ -14,7 +14,7 @@ import {
icoPath,
platform,
productName,
} from './scripts/make-env.js';
} from './scripts/make-env';

const fromBuildIdentifier = utils.fromBuildIdentifier;

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/electron/scripts/make-squirrel.ts
Expand Up @@ -12,7 +12,7 @@ import {
platform,
productName,
ROOT,
} from './make-env.js';
} from './make-env';

async function ensureDirectory(dir: string) {
if (await fs.pathExists(dir)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/i18n/src/scripts/api.ts
@@ -1,7 +1,7 @@
import type { Response } from 'undici-types';

// cSpell:ignore Tolgee
import { fetchTolgee } from './request.js';
import { fetchTolgee } from './request';

/**
* Returns all project languages
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/i18n/src/scripts/download.ts
Expand Up @@ -4,9 +4,9 @@ import * as path from 'node:path';

import { format } from 'prettier';

import { getAllProjectLanguages, getRemoteTranslations } from './api.js';
import type { TranslationRes } from './utils.js';
import { flattenTranslation } from './utils.js';
import { getAllProjectLanguages, getRemoteTranslations } from './api';
import type { TranslationRes } from './utils';
import { flattenTranslation } from './utils';

const INDENT = 2;
const RES_DIR = path.resolve(process.cwd(), 'src', 'resources');
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/i18n/src/scripts/sync.ts
Expand Up @@ -2,8 +2,8 @@
import { readFile } from 'node:fs/promises';
import { resolve } from 'node:path';

import { createsNewKey, getRemoteTranslations } from './api.js';
import type { TranslationRes } from './utils.js';
import { createsNewKey, getRemoteTranslations } from './api';
import type { TranslationRes } from './utils';

const BASE_JSON_PATH = resolve(process.cwd(), 'src', 'resources', 'en.json');
const BASE_LANGUAGES = 'en' as const;
Expand Down
8 changes: 4 additions & 4 deletions tools/cli/src/bin/build.ts
Expand Up @@ -2,10 +2,10 @@ import path from 'node:path';

import webpack from 'webpack';

import type { BuildFlags } from '../config/index.js';
import { projectRoot } from '../config/index.js';
import { buildI18N } from '../util/i18n.js';
import { createWebpackConfig } from '../webpack/webpack.config.js';
import type { BuildFlags } from '../config/index';
import { projectRoot } from '../config/index';
import { buildI18N } from '../util/i18n';
import { createWebpackConfig } from '../webpack/webpack.config';

let cwd: string;

Expand Down
8 changes: 4 additions & 4 deletions tools/cli/src/bin/dev.ts
Expand Up @@ -6,10 +6,10 @@ import { config } from 'dotenv';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';

import type { BuildFlags } from '../config/index.js';
import { projectRoot } from '../config/index.js';
import { watchI18N } from '../util/i18n.js';
import { createWebpackConfig } from '../webpack/webpack.config.js';
import type { BuildFlags } from '../config/index';
import { projectRoot } from '../config/index';
import { watchI18N } from '../util/i18n';
import { createWebpackConfig } from '../webpack/webpack.config';

const flags: BuildFlags = {
distribution: 'browser',
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/src/util/i18n.ts
Expand Up @@ -2,7 +2,7 @@ import { resolve } from 'node:path';

import { runCli } from '@magic-works/i18n-codegen';

import { projectRoot } from '../config/index.js';
import { projectRoot } from '../config/index';

const configPath = resolve(projectRoot, '.i18n-codegen.json');

Expand Down
2 changes: 1 addition & 1 deletion tools/cli/src/util/infra.ts
Expand Up @@ -3,7 +3,7 @@ import { resolve } from 'node:path';

import { build } from 'vite';

import { projectRoot } from '../config/index.js';
import { projectRoot } from '../config/index';

const infraFilePath = resolve(
projectRoot,
Expand Down
8 changes: 4 additions & 4 deletions tools/cli/src/webpack/config.ts
Expand Up @@ -14,10 +14,10 @@ import TerserPlugin from 'terser-webpack-plugin';
import webpack from 'webpack';
import type { Configuration as DevServerConfiguration } from 'webpack-dev-server';

import type { BuildFlags } from '../config/index.js';
import { projectRoot } from '../config/index.js';
import { productionCacheGroups } from './cache-group.js';
import { WebpackS3Plugin } from './s3-plugin.js';
import type { BuildFlags } from '../config/index';
import { projectRoot } from '../config/index';
import { productionCacheGroups } from './cache-group';
import { WebpackS3Plugin } from './s3-plugin';

const IN_CI = !!process.env.CI;

Expand Down
4 changes: 2 additions & 2 deletions tools/cli/src/webpack/webpack.config.ts
Expand Up @@ -7,8 +7,8 @@ import HTMLPlugin from 'html-webpack-plugin';
import { once } from 'lodash-es';
import { merge } from 'webpack-merge';

import { createConfiguration, rootPath, workspaceRoot } from './config.js';
import { getRuntimeConfig } from './runtime-config.js';
import { createConfiguration, rootPath, workspaceRoot } from './config';
import { getRuntimeConfig } from './runtime-config';

const DESCRIPTION = `There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together.`;

Expand Down