Replies: 7 comments 3 replies
-
|
Our top candidate: [
"builtin",
["external", "subpath"],
"internal",
["parent", "sibling", "index"],
"style",
"side-effect",
"side-effect-style",
"unknown"
]📝 Code exampleimport fs from "node:fs"; // [builtin, import] [value, default]
import type { Readable } from "node:stream"; // [type, builtin, import] [type, named]
import { subpathFn } from "#lib"; // [subpath, external, import] [value, named]
import type { SubpathType } from "#types"; // [type, subpath, external, import] [type, named]
import React from "react"; // [external, import] [value, default]
import type { FC } from "react"; // [type, external, import] [type, named]
import { z } from "zod"; // [external, import] [value, named]
import { config } from "~/config"; // [internal, import] [value, named]
import type { AppConfig } from "~/types"; // [type, internal, import] [type, named]
import { parentFn } from "../lib"; // [parent, import] [value, named]
import type { ParentType } from "../types"; // [type, parent, import] [type, named]
import { indexFn } from "./index"; // [index, import] [value, named]
import type { IndexType } from "./index.ts"; // [type, index, import] [type, named]
import { siblingFn } from "./lib"; // [sibling, import] [value, named]
import type { SiblingType } from "./types"; // [type, sibling, import] [type, named]
import styles from "./local.module.css"; // [style, sibling, import] [value, default]
import "reflect-metadata"; // [side-effect, external, import] [side-effect, value]
import "~/polyfill"; // [side-effect, internal, import] [side-effect, value]
import "../globals/polyfill"; // [side-effect, parent, import] [side-effect, value]
import "normalize.css"; // [side-effect-style, side-effect, style, external, import] [side-effect, value]
import "./component.css"; // [side-effect-style, side-effect, style, sibling, import] [side-effect, value]
|
Beta Was this translation helpful? Give feedback.
-
[
"builtin",
["external", "subpath"],
"internal",
["parent", "sibling", "index"],
"type-builtin",
["type-external", "type-subpath"],
"type-internal",
"type-parent", "type-sibling", "type-index",
"style",
"side-effect",
"side-effect-style",
"unknown",
]📝 Code exampleimport fs from "node:fs"; // [builtin, import] [value, default]
import { subpathFn } from "#lib"; // [subpath, external, import] [value, named]
import React from "react"; // [external, import] [value, default]
import { z } from "zod"; // [external, import] [value, named]
import { config } from "~/config"; // [internal, import] [value, named]
import { parentFn } from "../lib"; // [parent, import] [value, named]
import { indexFn } from "./index"; // [index, import] [value, named]
import { siblingFn } from "./lib"; // [sibling, import] [value, named]
import type { Readable } from "node:stream"; // [type, builtin, import] [type, named]
import type { SubpathType } from "#types"; // [type, subpath, external, import] [type, named]
import type { FC } from "react"; // [type, external, import] [type, named]
import type { AppConfig } from "~/types"; // [type, internal, import] [type, named]
import type { ParentType } from "../types"; // [type, parent, import] [type, named]
import type { SiblingType } from "./types"; // [type, sibling, import] [type, named]
import type { IndexType } from "./index.ts"; // [type, index, import] [type, named]
import styles from "./local.module.css"; // [style, sibling, import] [value, default]
import "reflect-metadata"; // [side-effect, external, import] [side-effect, value]
import "~/polyfill"; // [side-effect, internal, import] [side-effect, value]
import "../globals/polyfill"; // [side-effect, parent, import] [side-effect, value]
import "normalize.css"; // [side-effect-style, side-effect, style, external, import] [side-effect, value]
import "./component.css"; // [side-effect-style, side-effect, style, sibling, import] [side-effect, value]
|
Beta Was this translation helpful? Give feedback.
-
|
i will like my import
import { Cookie } from "#http/request/cookie.js";
import { get, omit, pick, sortBy } from "lodash";
import { ValidationException } from "#validation/exceptions.js";
import mimeDB from "mime-db";
import type { Application } from "#server/application.js";
import type { BodyParserStore } from "#http/request/body_parser/body_parser_store.js";
import type { Encryption } from "#encryption/encryption.js";
import type { HeaderByQuality, HttpMethodType } from "#http/request/types.js";
import type { RouteNodeState } from "#router/types.js";
import type { ZodObject, ZodRawShape } from "#validation/types.js";please support this option!! |
Beta Was this translation helpful? Give feedback.
-
|
I’m curious why {
"imports": {
"#internal/*.js": "./src/internal/*.js"
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Right now I'm using Here is an example of what we've been using: [
"<BUILTIN_MODULES>",
"<THIRD_PARTY_MODULES>",
"",
"^(?!.*[.]css$)[./].*$",
"",
".css$"
] |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
|
Thank you all very much. 🙏🏻 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Oxfmt experimentally implements a feature to order
importdeclarations.The default grouping order currently looks like this:
📝 Code example
This is (roughly) equivalent to the default behavior of the reference implementation,
eslint-plugin-perfectionist/sort-imports.typetakes precedenceside-effectHowever, after examining sort-imports configurations on GitHub (like `prettier-plugin-sort-imports, etc), We wondered if Oxfmt could provide better defaults.
Beta Was this translation helpful? Give feedback.
All reactions