Skip to content

Commit

Permalink
refactor: improve and standardize import order (#933)
Browse files Browse the repository at this point in the history
refactor: improve import order
  • Loading branch information
wellwelwel authored Feb 2, 2025
1 parent 1a6aeaa commit a96f9ab
Show file tree
Hide file tree
Showing 126 changed files with 602 additions and 320 deletions.
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
"endOfLine": "auto",
"embeddedLanguageFormatting": "auto",
"singleAttributePerLine": false,
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
"importOrder": [
"<TYPES>^(node:)",
"<TYPES>",
"<TYPES>^[.]",
"<BUILTIN_MODULES>",
"<THIRD_PARTY_MODULES>",
"^[.]"
],
"overrides": [
{
"files": "*.jsonc",
Expand Down
227 changes: 227 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
"@types/node": "^22.12.0",
"c8": "^10.1.3",
"jsonc.min": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/@types/poku.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AssertionError } from 'node:assert';
import type { results } from '../configs/poku.js';
import type { Configs as ListFilesConfigs } from './list-files.js';
import type { ProcessAssertionOptions } from './assert.js';
import type { DescribeOptions } from './describe.js';
import type { Configs as ListFilesConfigs } from './list-files.js';

type CustomString = string & NonNullable<unknown>;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/help.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { format } from '../services/format.js';
import { log, hr } from '../services/write.js';
import { hr, log } from '../services/write.js';

const b = (text: string) => `${format(text).bold()}`;
const i = (text: string) => `${format(text).italic()}`;
Expand Down
15 changes: 7 additions & 8 deletions src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#! /usr/bin/env node
import { escapeRegExp } from '../modules/helpers/list-files.js';
import { getArg, getPaths, hasArg, argToArray } from '../parsers/get-arg.js';
import { states } from '../configs/poku.js';
import { format } from '../services/format.js';
import { kill } from '../modules/helpers/kill.js';
import { envFile } from '../modules/helpers/env.js';
import { GLOBAL, states, VERSION } from '../configs/poku.js';
import { poku } from '../modules/essentials/poku.js';
import { log, hr } from '../services/write.js';
import { envFile } from '../modules/helpers/env.js';
import { kill } from '../modules/helpers/kill.js';
import { escapeRegExp } from '../modules/helpers/list-files.js';
import { argToArray, getArg, getPaths, hasArg } from '../parsers/get-arg.js';
import { getConfigs } from '../parsers/options.js';
import { GLOBAL, VERSION } from '../configs/poku.js';
import { format } from '../services/format.js';
import { hr, log } from '../services/write.js';

(async () => {
/* c8 ignore next 4 */ // Version is tested during build process: "../../tools/build/version.ts"
Expand Down
13 changes: 7 additions & 6 deletions src/bin/watch.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { mapTests, normalizePath } from '../services/map-tests.js';
import { watch, type Watcher } from '../services/watch.js';
import { onSigint, poku } from '../modules/essentials/poku.js';
import { log, hr } from '../services/write.js';
import type { Watcher } from '../services/watch.js';
import process from 'node:process';
import { format } from '../services/format.js';
import { GLOBAL } from '../configs/poku.js';
import { onSigint, poku } from '../modules/essentials/poku.js';
import { getArg } from '../parsers/get-arg.js';
import { availableParallelism } from '../polyfills/os.js';
import { GLOBAL } from '../configs/poku.js';
import { format } from '../services/format.js';
import { mapTests, normalizePath } from '../services/map-tests.js';
import { errors } from '../services/reporters/poku.js';
import { watch } from '../services/watch.js';
import { hr, log } from '../services/write.js';

export const startWatch = async (dirs: string[]) => {
let isRunning = false;
Expand Down
2 changes: 1 addition & 1 deletion src/builders/assert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ProcessAssertionOptions } from '../@types/assert.js';
import type assert from 'node:assert';
import type { AssertPredicate } from 'node:assert';
import type { ProcessAssertionOptions } from '../@types/assert.js';
import { processAssert, processAsyncAssert } from '../services/assert.js';

export const createAssert = (nodeAssert: typeof assert) => {
Expand Down
Loading

0 comments on commit a96f9ab

Please sign in to comment.