@1adybug/prettier 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { readFileSync } from "fs";
2
2
  import { builtinModules } from "module";
3
- import json5 from "json5";
4
- import prettier_plugin_block_padding from "prettier-plugin-block-padding";
5
3
  import prettier_plugin_remove_braces from "@1adybug/prettier-plugin-remove-braces";
6
4
  import { createPlugin } from "@1adybug/prettier-plugin-sort-imports";
5
+ import json5 from "json5";
6
+ import prettier_plugin_block_padding from "prettier-plugin-block-padding";
7
7
  import * as __rspack_external_prettier_plugin_tailwindcss_a3404f7e from "prettier-plugin-tailwindcss";
8
8
  const packageJson = json5.parse(readFileSync("package.json", "utf-8"));
9
9
  function hasDependency(dependency) {
@@ -68,9 +68,10 @@ const otherPlugins = hasTailwindcss ? [
68
68
  ];
69
69
  const src_plugin = createPlugin({
70
70
  getGroup ({ path }) {
71
+ const type = getModuleType(path);
71
72
  const info = {
72
- type: getModuleType(path),
73
- dir: getDir(path)
73
+ type,
74
+ dir: "absolute" === type || "relative" === type ? getDir(path) : ""
74
75
  };
75
76
  return JSON.stringify(info);
76
77
  },
@@ -79,7 +80,6 @@ const src_plugin = createPlugin({
79
80
  },
80
81
  separator: "",
81
82
  sortSideEffect: true,
82
- removeUnusedImports: true,
83
83
  otherPlugins
84
84
  });
85
85
  const src = src_plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1adybug/prettier",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "自用的 Prettier 配置",
5
5
  "keywords": [
6
6
  "prettier",