@powerlines/plugin-unimport 0.1.678 → 0.1.680
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.
- package/README.md +32 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -74,6 +74,38 @@ A Powerlines plugin to add imports to source code automatically via [unimport](h
|
|
|
74
74
|
|
|
75
75
|
<!-- END doctoc -->
|
|
76
76
|
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- Adds missing imports to source code automatically with [unimport](https://unjs.io/packages/unimport)
|
|
80
|
+
- Requires `presets` to define the auto-import sources
|
|
81
|
+
- Resolves presets and import scanning through the `config` and `configResolved` hooks
|
|
82
|
+
- Supports opting a file out with the `// @unimport-disable` magic comment
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
Install the plugin:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pnpm add @powerlines/plugin-unimport
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Register it in `powerlines.config.ts` (`presets` is required):
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { plugin as unimport } from "@powerlines/plugin-unimport";
|
|
96
|
+
import { defineConfig } from "powerlines/config";
|
|
97
|
+
|
|
98
|
+
export default defineConfig({
|
|
99
|
+
plugins: [unimport({ presets: [] })]
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The plugin adds missing imports to source code once registered. To skip a file, add:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// @unimport-disable
|
|
107
|
+
```
|
|
108
|
+
|
|
77
109
|
## Installing
|
|
78
110
|
|
|
79
111
|
Using [pnpm](http://pnpm.io):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-unimport",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.680",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to add imports to source code automatically via unimport.",
|
|
6
6
|
"repository": {
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
"@stryke/path": "^0.29.43",
|
|
96
96
|
"defu": "^6.1.7",
|
|
97
97
|
"magic-string": "^0.30.21",
|
|
98
|
-
"powerlines": "^0.47.
|
|
98
|
+
"powerlines": "^0.47.217",
|
|
99
99
|
"unimport": "^5.7.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
102
|
+
"@powerlines/plugin-plugin": "^0.12.630",
|
|
103
103
|
"@types/node": "^25.9.9"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": { "access": "public" },
|
|
106
106
|
"types": "./dist/index.d.cts",
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "bb4e1f2b32a8bb9d20559ca7c3df3a2f30a0d14e"
|
|
108
108
|
}
|