@1adybug/prettier 0.0.12 → 0.0.13

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 +2 -14
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import prettier_plugin_remove_braces from "@1adybug/prettier-plugin-remove-brace
6
6
  import { createPlugin } from "@1adybug/prettier-plugin-sort-imports";
7
7
  import { createMatchPath, loadConfig } from "tsconfig-paths";
8
8
  import * as __rspack_external_prettier_plugin_tailwindcss_a3404f7e from "prettier-plugin-tailwindcss";
9
- const src_require = createRequire(import.meta.url);
9
+ createRequire(import.meta.url);
10
10
  function fileExistsWithAnyExtension(path) {
11
11
  if (existsSync(path)) return true;
12
12
  const { dir, base } = parse(path);
@@ -37,14 +37,6 @@ function getResolveAlias(filepath) {
37
37
  return;
38
38
  }
39
39
  }
40
- function hasDependency(dependency) {
41
- try {
42
- src_require.resolve(dependency);
43
- return true;
44
- } catch (error) {
45
- return false;
46
- }
47
- }
48
40
  function isReact(path) {
49
41
  return /^(npm:)?react(-dom|-native)?(\/|$)/.test(path);
50
42
  }
@@ -76,14 +68,10 @@ function getModuleType(path) {
76
68
  if (isRelative(path)) return "relative";
77
69
  return "third-party";
78
70
  }
79
- const hasTailwindcss = hasDependency("tailwindcss");
80
- const otherPlugins = hasTailwindcss ? [
71
+ const otherPlugins = [
81
72
  prettier_plugin_block_padding,
82
73
  __rspack_external_prettier_plugin_tailwindcss_a3404f7e,
83
74
  prettier_plugin_remove_braces
84
- ] : [
85
- prettier_plugin_block_padding,
86
- prettier_plugin_remove_braces
87
75
  ];
88
76
  let src_resolveAlias;
89
77
  function getResolvedPathDir(resolvedPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1adybug/prettier",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "推荐的 Prettier 配置",
5
5
  "keywords": [
6
6
  "prettier",
@@ -38,9 +38,9 @@
38
38
  "dependencies": {
39
39
  "prettier-plugin-tailwindcss": "^0.7.1",
40
40
  "tsconfig-paths": "^4.2.0",
41
- "@1adybug/prettier-plugin-sort-imports": "0.0.20",
42
- "@1adybug/prettier-plugin-block-padding": "0.0.12",
43
- "@1adybug/prettier-plugin-remove-braces": "0.0.6"
41
+ "@1adybug/prettier-plugin-sort-imports": "0.0.21",
42
+ "@1adybug/prettier-plugin-block-padding": "0.0.13",
43
+ "@1adybug/prettier-plugin-remove-braces": "0.0.7"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@rslib/core": "^0.18.2",
@@ -48,7 +48,7 @@
48
48
  "typescript": "^5.9.3"
49
49
  },
50
50
  "peerDependencies": {
51
- "prettier": "^3.0.0"
51
+ "prettier": "^3.7.3"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "rslib build",