Skip to content

Commit

Permalink
fix: importing incorrectly from dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-buss committed Jul 10, 2024
1 parent 76c051c commit fbe84e7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @ts-expect-error missing types
import styleMigrate from "@stylistic/eslint-plugin-migrate";

import style from "./dist/index.js";
// eslint-disable-next-line antfu/no-import-dist -- Need the compiled version.
import { style } from "./dist";

export default style(
{
Expand Down
12 changes: 12 additions & 0 deletions src/configs/imports.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { GLOB_SRC_EXT } from "src/globs";

import { pluginAntfu, pluginImport, pluginSimpleImportSort } from "../plugins";
import type { OptionsStylistic, TypedFlatConfigItem } from "../types";

Expand All @@ -13,6 +15,8 @@ export async function imports(options: OptionsStylistic = {}): Promise<Array<Typ
},
rules: {
"antfu/import-dedupe": "error",
"antfu/no-import-dist": "error",
"antfu/no-import-node-modules-by-path": "error",

"import/first": "error",
"import/no-duplicates": "error",
Expand Down Expand Up @@ -52,5 +56,13 @@ export async function imports(options: OptionsStylistic = {}): Promise<Array<Typ
],
},
},
{
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
name: "antfu/imports/disables/bin",
rules: {
"antfu/no-import-dist": "off",
"antfu/no-import-node-modules-by-path": "off",
},
},
];
}
2 changes: 1 addition & 1 deletion src/configs/package-json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TypedFlatConfigItem } from "dist";
import type { TypedFlatConfigItem } from "src";
import { pluginPackageJson } from "src/plugins";
import { interopDefault } from "src/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/typegen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28031,4 +28031,4 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
onlyEquality?: boolean
}]
// Names of all the configs
export type ConfigNames = 'style:eslint-comments' | 'style:formatters:setup' | 'style:imports' | 'style:import-sort' | 'style:jsdoc' | 'style:jsonc:setup' | 'style:jsonc:rules' | 'style:markdown:setup' | 'style:markdown:processor' | 'style:markdown:parser' | 'style:markdown:disables' | 'style:package-json' | 'style:perfectionist' | 'style:promise' | 'style:react:setup' | 'style:react:rules' | 'style:roblox' | 'style:shopify' | 'style:sonarjs' | 'style:sort-tsconfig' | 'style:spelling' | 'style:stylistic' | 'style:typescript:setup' | 'style:typescript:rules' | 'style:typescript:dts-overrides' | 'style:unicorn' | 'style:yaml:setup' | 'style:yaml:rules'
export type ConfigNames = 'style:eslint-comments' | 'style:formatters:setup' | 'style:imports' | 'style:import-sort' | 'antfu/imports/disables/bin' | 'style:jsdoc' | 'style:jsonc:setup' | 'style:jsonc:rules' | 'style:markdown:setup' | 'style:markdown:processor' | 'style:markdown:parser' | 'style:markdown:disables' | 'style:package-json' | 'style:perfectionist' | 'style:promise' | 'style:react:setup' | 'style:react:rules' | 'style:roblox' | 'style:shopify' | 'style:sonarjs' | 'style:sort-tsconfig' | 'style:spelling' | 'style:stylistic' | 'style:typescript:setup' | 'style:typescript:rules' | 'style:typescript:dts-overrides' | 'style:unicorn' | 'style:yaml:setup' | 'style:yaml:rules'

0 comments on commit fbe84e7

Please sign in to comment.