Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cfabeb5

Browse files
committedMar 14, 2025··
chore: ensure only one prettier installed
1 parent fb7209b commit cfabeb5

File tree

4 files changed

+28
-35
lines changed

4 files changed

+28
-35
lines changed
 

‎.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
test/fixtures/just-json-files/invalid.json
33
test/fixtures/malformed.js
44
test/fixtures/with-syntax-error/package.json
5-
CHANGELOG.md

‎CHANGELOG.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,24 @@
167167

168168
```ts
169169
export interface NewResolver {
170-
interfaceVersion: 3;
171-
name?: string; // This will be included in the debug log
172-
resolve: (modulePath: string, sourceFile: string) => ResolvedResult;
170+
interfaceVersion: 3
171+
name?: string // This will be included in the debug log
172+
resolve: (modulePath: string, sourceFile: string) => ResolvedResult
173173
}
174174

175175
// The `ResultNotFound` (returned when not resolved) is the same, no changes
176176
export interface ResultNotFound {
177-
found: false;
178-
path?: undefined;
177+
found: false
178+
path?: undefined
179179
}
180180

181181
// The `ResultFound` (returned resolve result) is also the same, no changes
182182
export interface ResultFound {
183-
found: true;
184-
path: string | null;
183+
found: true
184+
path: string | null
185185
}
186186

187-
export type ResolvedResult = ResultNotFound | ResultFound;
187+
export type ResolvedResult = ResultNotFound | ResultFound
188188
```
189189
190190
You will be able to import `NewResolver` from `eslint-plugin-import-x/types`.
@@ -231,33 +231,33 @@
231231
resolve(mod, source) {
232232
// every time the `resolve` function is called, a new instance is created
233233
// This is very slow
234-
const resolverInstance = ResolverFactory.createResolver({});
235-
const found = resolverInstance.resolve(mod, {});
234+
const resolverInstance = ResolverFactory.createResolver({})
235+
const found = resolverInstance.resolve(mod, {})
236236
},
237-
};
237+
}
238238
```
239239

240240
With the factory function pattern, you can create a resolver instance beforehand:
241241

242242
```js
243-
exports.createCustomResolver = (options) => {
243+
exports.createCustomResolver = options => {
244244
// `enhance-resolve` allows you to create a reusable instance:
245-
const resolverInstance = ResolverFactory.createResolver({});
246-
const resolverInstance = enhanceResolve.create({});
245+
const resolverInstance = ResolverFactory.createResolver({})
246+
const resolverInstance = enhanceResolve.create({})
247247

248248
// `oxc-resolver` also allows you to create a reusable instance:
249-
const resolverInstance = new ResolverFactory({});
249+
const resolverInstance = new ResolverFactory({})
250250

251251
return {
252-
name: "custom-resolver",
252+
name: 'custom-resolver',
253253
interfaceVersion: 3,
254254
resolve(mod, source) {
255255
// the same re-usable instance is shared across `resolve` invocations.
256256
// more performant
257-
const found = resolverInstance.resolve(mod, {});
257+
const found = resolverInstance.resolve(mod, {})
258258
},
259-
};
260-
};
259+
}
260+
}
261261
```
262262

263263
### Patch Changes
@@ -359,12 +359,12 @@
359359
- [#122](https://github.com/un-ts/eslint-plugin-import-x/pull/122) [`cd52e86`](https://github.com/un-ts/eslint-plugin-import-x/commit/cd52e86f44754b4dd0c1aae1e9fd5e952e90938f) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:
360360

361361
```ts
362-
import eslintPluginImportX from "eslint-plugin-import-x";
362+
import eslintPluginImportX from 'eslint-plugin-import-x'
363363

364-
eslintPluginImportX.flatConfigs.recommended;
365-
eslintPluginImportX.flatConfigs.react;
366-
eslintPluginImportX.flatConfigs.typescript;
367-
eslintPluginImportX.flatConfigs.electron;
364+
eslintPluginImportX.flatConfigs.recommended
365+
eslintPluginImportX.flatConfigs.react
366+
eslintPluginImportX.flatConfigs.typescript
367+
eslintPluginImportX.flatConfigs.electron
368368
```
369369

370370
- [#132](https://github.com/un-ts/eslint-plugin-import-x/pull/132) [`9948c78`](https://github.com/un-ts/eslint-plugin-import-x/commit/9948c7894758dd461f6d75b89c6425fee304789a) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by @whitneyit, ported by @SukkaW

‎package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,8 @@
132132
"typescript": "^5.8.2",
133133
"yarn-berry-deduplicate": "^6.1.1",
134134
"zod": "^3.24.2"
135+
},
136+
"resolutions": {
137+
"prettier": "^3.5.3"
135138
}
136139
}

‎yarn.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9908,7 +9908,7 @@ __metadata:
99089908
languageName: node
99099909
linkType: hard
99109910

9911-
"prettier@npm:>=3.0.0-alpha.3, prettier@npm:^3.5.3":
9911+
"prettier@npm:^3.5.3":
99129912
version: 3.5.3
99139913
resolution: "prettier@npm:3.5.3"
99149914
bin:
@@ -9917,15 +9917,6 @@ __metadata:
99179917
languageName: node
99189918
linkType: hard
99199919

9920-
"prettier@npm:^2.7.1":
9921-
version: 2.8.8
9922-
resolution: "prettier@npm:2.8.8"
9923-
bin:
9924-
prettier: bin-prettier.js
9925-
checksum: 10c0/463ea8f9a0946cd5b828d8cf27bd8b567345cf02f56562d5ecde198b91f47a76b7ac9eae0facd247ace70e927143af6135e8cf411986b8cb8478784a4d6d724a
9926-
languageName: node
9927-
linkType: hard
9928-
99299920
"pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0":
99309921
version: 29.7.0
99319922
resolution: "pretty-format@npm:29.7.0"

0 commit comments

Comments
 (0)
Please sign in to comment.