Skip to content

Commit fa1f6ed

Browse files
authored
style: use dprint for imports and exports sorting (#1175)
1 parent 8f31f4c commit fa1f6ed

File tree

153 files changed

+290
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+290
-339
lines changed

.pkgs/configs/eslint.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export const typescript = tseslint.config({
9595
}, {
9696
extends: [
9797
pluginDeMorgan.configs.recommended,
98-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
9998
pluginJsdoc.configs["flat/recommended-typescript-error"],
10099
pluginRegexp.configs["flat/recommended"],
101100
pluginPerfectionist.configs["recommended-natural"],
@@ -112,32 +111,8 @@ export const typescript = tseslint.config({
112111
"@stylistic/no-multi-spaces": ["warn"],
113112
"@stylistic/operator-linebreak": "off",
114113
"@stylistic/quote-props": ["error", "as-needed"],
115-
"perfectionist/sort-exports": ["warn", { type: "natural", order: "asc" }],
116-
"perfectionist/sort-imports": ["warn", {
117-
type: "natural",
118-
groups: [
119-
"type",
120-
[
121-
"parent-type",
122-
"sibling-type",
123-
"index-type",
124-
"internal-type",
125-
],
126-
"builtin",
127-
"external",
128-
"internal",
129-
[
130-
"parent",
131-
"sibling",
132-
"index",
133-
],
134-
"side-effect",
135-
"object",
136-
"unknown",
137-
],
138-
newlinesBetween: "ignore",
139-
order: "asc",
140-
}],
114+
"perfectionist/sort-exports": "off",
115+
"perfectionist/sort-imports": "off",
141116
"perfectionist/sort-interfaces": [
142117
"warn",
143118
{ ...p11tOptions, ...p11tGroups },

.pkgs/configs/eslint.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const typescript: ConfigArray = tseslint.config(
107107
{
108108
extends: [
109109
pluginDeMorgan.configs.recommended,
110-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
110+
111111
pluginJsdoc.configs["flat/recommended-typescript-error"],
112112
pluginRegexp.configs["flat/recommended"],
113113
pluginPerfectionist.configs["recommended-natural"],
@@ -126,32 +126,8 @@ export const typescript: ConfigArray = tseslint.config(
126126
"@stylistic/operator-linebreak": "off",
127127
"@stylistic/quote-props": ["error", "as-needed"],
128128

129-
"perfectionist/sort-exports": ["warn", { type: "natural", order: "asc" }],
130-
"perfectionist/sort-imports": ["warn", {
131-
type: "natural",
132-
groups: [
133-
"type",
134-
[
135-
"parent-type",
136-
"sibling-type",
137-
"index-type",
138-
"internal-type",
139-
],
140-
"builtin",
141-
"external",
142-
"internal",
143-
[
144-
"parent",
145-
"sibling",
146-
"index",
147-
],
148-
"side-effect",
149-
"object",
150-
"unknown",
151-
],
152-
newlinesBetween: "ignore",
153-
order: "asc",
154-
}],
129+
"perfectionist/sort-exports": "off",
130+
"perfectionist/sort-imports": "off",
155131
"perfectionist/sort-interfaces": [
156132
"warn",
157133
{ ...p11tOptions, ...p11tGroups },

.pkgs/eslint-plugin-local/src/rules/avoid-multiline-template-expression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import * as AST from "@eslint-react/ast";
12
import type { RuleContext, RuleFeature } from "@eslint-react/kit";
23
import type { RuleListener } from "@typescript-eslint/utils/ts-eslint";
34
import type { CamelCase } from "string-ts";
4-
import * as AST from "@eslint-react/ast";
55

66
import { createRule } from "../utils";
77

.pkgs/eslint-plugin-local/src/utils/is-initialized-from-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { Scope } from "@typescript-eslint/scope-manager";
2-
import type { TSESTree } from "@typescript-eslint/types";
31
import * as AST from "@eslint-react/ast";
42
import { unit } from "@eslint-react/eff";
53
import { findVariable } from "@eslint-react/var";
4+
import type { Scope } from "@typescript-eslint/scope-manager";
5+
import type { TSESTree } from "@typescript-eslint/types";
66
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
77

88
/**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ npm install --save-dev typescript-eslint @eslint-react/eslint-plugin
6969
// eslint.config.js
7070

7171
// @ts-check
72-
import eslintJs from "@eslint/js";
7372
import eslintReact from "@eslint-react/eslint-plugin";
73+
import eslintJs from "@eslint/js";
7474
import tseslint from "typescript-eslint";
7575

7676
export default tseslint.config({

apps/website/app/docs/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Docs layout
2-
import type { ReactNode } from "react";
32
import { baseOptions } from "#/app/layout.config";
3+
import type { ReactNode } from "react";
44

55
import { source } from "#/lib/source";
66
import { DocsLayout } from "fumadocs-ui/layouts/docs";

apps/website/app/layout.config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
21
import logo from "#/assets/logo.svg";
2+
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
33

44
import Image from "next/image";
55
import React from "react";

apps/website/components/ESLintReact.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { StaticImageData } from "next/image";
21
import logo from "#/assets/logo.svg";
2+
import type { StaticImageData } from "next/image";
33
import Image from "next/image";
44
import React from "react";
55

apps/website/components/ui/Callout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { Pretty } from "@eslint-react/eff";
2-
import type React from "react";
31
import { cn } from "#/lib/cn";
2+
import type { Pretty } from "@eslint-react/eff";
43
import { Callout as FDCallout } from "fumadocs-ui/components/callout";
4+
import type React from "react";
55

66
export type CalloutProps = Pretty<Parameters<typeof FDCallout>[0]> & { ref?: React.RefObject<HTMLDivElement | null> };
77

dprint.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"indentWidth": 2,
55
"quoteStyle": "preferDouble",
66
"quoteProps": "asNeeded",
7-
"importDeclaration.sortNamedImports": "maintain",
8-
"exportDeclaration.sortNamedExports": "maintain",
9-
"module.sortImportDeclarations": "maintain",
10-
"module.sortExportDeclarations": "maintain"
7+
"importDeclaration.sortNamedImports": "caseInsensitive",
8+
"exportDeclaration.sortNamedExports": "caseInsensitive",
9+
"module.sortImportDeclarations": "caseInsensitive",
10+
"module.sortExportDeclarations": "caseInsensitive"
1111
},
1212
"json": {
1313
"indentWidth": 2

0 commit comments

Comments
 (0)