You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: add workspace alias for @antfu/eslint-config
- Introduced a new package `@antfu/eslint-config` to serve as a workspace alias for `@pixpilot/eslint-config`.
- This allows test fixtures and configurations that import `@antfu/eslint-config` to function without modification.
- Maintains compatibility with upstream changes while using a custom package name.
- Updated `pnpm-workspace.yaml` and `pnpm-lock.yaml` to include the new alias package.
This document explains how to maintain test compatibility when forking `@antfu/eslint-config` and changing the package name to `@pixpilot/eslint-config`.
4
+
5
+
## Problem
6
+
7
+
When you fork the original `@antfu/eslint-config` repository and change the package name in `package.json` to `@pixpilot/eslint-config`, the test fixtures fail because they still import `@antfu/eslint-config`.
8
+
9
+
## Solution: Workspace Package Alias
10
+
11
+
Instead of changing all test references (which would make merging upstream changes difficult), we create a **workspace package** that acts as an alias, redirecting `@antfu/eslint-config` imports to our local `@pixpilot/eslint-config` build.
12
+
13
+
### How It Works
14
+
15
+
1.**Main package**: Your `@pixpilot/eslint-config` builds to `dist/`
16
+
2.**Workspace alias**: `packages/antfu-eslint-config/` contains a package named `@antfu/eslint-config` that re-exports your main package
17
+
3.**PNPM workspace**: Both packages are part of the same workspace with `@antfu/eslint-config: workspace:*` dependency
18
+
4.**Tests work**: Test fixtures import `@antfu/eslint-config` but get your `@pixpilot/eslint-config` code
> This repository is a fork of [@antfu/eslint-config](https://github.com/antfu/eslint-config).
5
+
>
6
+
> **Reason for Fork:**
7
+
> The main purpose of this fork is to move Vue-related dependencies to `peerDependencies`, making this library more generic and suitable for any project—whether it is a library, React, Vue, or others. Only essential libraries are included as dependencies; framework-specific integrations should be added as peer dependencies by the consumer as needed.
- Auto fix for formatting (aimed to be used standalone **without** Prettier)
6
12
- Reasonable defaults, best practices, only one line of config
@@ -38,24 +44,24 @@
38
44
We provided a CLI tool to help you set up your project, or migrate from the legacy config to the new flat config with one command.
39
45
40
46
```bash
41
-
pnpm dlx @antfu/eslint-config@latest
47
+
pnpm dlx @pixpilot/eslint-config@latest
42
48
```
43
49
44
50
### Manual Install
45
51
46
52
If you prefer to set up manually:
47
53
48
54
```bash
49
-
pnpm i -D eslint @antfu/eslint-config
55
+
pnpm i -D eslint @pixpilot/eslint-config
50
56
```
51
57
52
58
And create `eslint.config.mjs` in your project root:
53
59
54
60
```js
55
61
// eslint.config.mjs
56
-
importantfufrom'@antfu/eslint-config'
62
+
importconfigfrom'@pixpilot/eslint-config'
57
63
58
-
exportdefaultantfu()
64
+
exportdefaultconfig()
59
65
```
60
66
61
67
<details>
@@ -66,9 +72,9 @@ Combined with legacy config:
66
72
If you still use some configs from the legacy eslintrc format, you can use the [`@eslint/eslintrc`](https://www.npmjs.com/package/@eslint/eslintrc) package to convert them to the flat config.
67
73
68
74
```js
69
-
// eslint.config.mjs
70
-
importantfufrom'@antfu/eslint-config'
71
75
import { FlatCompat } from'@eslint/eslintrc'
76
+
// eslint.config.mjs
77
+
importantfufrom'@pixpilot/eslint-config'
72
78
73
79
constcompat=newFlatCompat()
74
80
@@ -262,7 +268,7 @@ Normally you only need to import the `antfu` preset:
262
268
263
269
```js
264
270
// eslint.config.js
265
-
importantfufrom'@antfu/eslint-config'
271
+
importantfufrom'@pixpilot/eslint-config'
266
272
267
273
exportdefaultantfu()
268
274
```
@@ -271,7 +277,7 @@ And that's it! Or you can configure each integration individually, for example:
271
277
272
278
```js
273
279
// eslint.config.js
274
-
importantfufrom'@antfu/eslint-config'
280
+
importantfufrom'@pixpilot/eslint-config'
275
281
276
282
exportdefaultantfu({
277
283
// Type of the project. 'lib' for libraries, the default is 'app'
@@ -306,7 +312,7 @@ The `antfu` factory function also accepts any number of arbitrary custom config
306
312
307
313
```js
308
314
// eslint.config.js
309
-
importantfufrom'@antfu/eslint-config'
315
+
importantfufrom'@pixpilot/eslint-config'
310
316
311
317
exportdefaultantfu(
312
318
{
@@ -352,7 +358,7 @@ import {
352
358
unicorn,
353
359
vue,
354
360
yaml,
355
-
} from'@antfu/eslint-config'
361
+
} from'@pixpilot/eslint-config'
356
362
357
363
exportdefaultcombine(
358
364
ignores(),
@@ -418,7 +424,7 @@ Since v2.9.0, this preset will automatically rename the plugins also for your cu
418
424
If you really want to use the original prefix, you can revert the plugin renaming by:
419
425
420
426
```ts
421
-
importantfufrom'@antfu/eslint-config'
427
+
importantfufrom'@pixpilot/eslint-config'
422
428
423
429
exportdefaultantfu()
424
430
.renamePlugins({
@@ -437,7 +443,7 @@ Certain rules would only be enabled in specific files, for example, `ts/*` rules
437
443
438
444
```js
439
445
// eslint.config.js
440
-
importantfufrom'@antfu/eslint-config'
446
+
importantfufrom'@pixpilot/eslint-config'
441
447
442
448
exportdefaultantfu(
443
449
{
@@ -464,7 +470,7 @@ We also provided the `overrides` options in each integration to make it easier:
464
470
465
471
```js
466
472
// eslint.config.js
467
-
importantfufrom'@antfu/eslint-config'
473
+
importantfufrom'@pixpilot/eslint-config'
468
474
469
475
exportdefaultantfu({
470
476
vue: {
@@ -491,7 +497,7 @@ Since v2.10.0, the factory function `antfu()` returns a [`FlatConfigComposer` ob
491
497
492
498
```js
493
499
// eslint.config.js
494
-
importantfufrom'@antfu/eslint-config'
500
+
importantfufrom'@pixpilot/eslint-config'
495
501
496
502
exportdefaultantfu()
497
503
.prepend(
@@ -520,7 +526,7 @@ Vue support is detected automatically by checking if `vue` is installed in your
520
526
521
527
```js
522
528
// eslint.config.js
523
-
importantfufrom'@antfu/eslint-config'
529
+
importantfufrom'@pixpilot/eslint-config'
524
530
525
531
exportdefaultantfu({
526
532
vue:true
@@ -533,7 +539,7 @@ We have limited support for Vue 2 (as it's already [reached EOL](https://v2.vuej
533
539
534
540
```js
535
541
// eslint.config.js
536
-
importantfufrom'@antfu/eslint-config'
542
+
importantfufrom'@pixpilot/eslint-config'
537
543
538
544
exportdefaultantfu({
539
545
vue: {
@@ -550,7 +556,7 @@ To enable Vue accessibility support, you need to explicitly turn it on:
550
556
551
557
```js
552
558
// eslint.config.js
553
-
importantfufrom'@antfu/eslint-config'
559
+
importantfufrom'@pixpilot/eslint-config'
554
560
555
561
exportdefaultantfu({
556
562
vue: {
@@ -575,7 +581,7 @@ Use external formatters to format files that ESLint cannot handle yet (`.css`, `
575
581
576
582
```js
577
583
// eslint.config.js
578
-
importantfufrom'@antfu/eslint-config'
584
+
importantfufrom'@pixpilot/eslint-config'
579
585
580
586
exportdefaultantfu({
581
587
formatters: {
@@ -611,7 +617,7 @@ To enable React support, you need to explicitly turn it on:
611
617
612
618
```js
613
619
// eslint.config.js
614
-
importantfufrom'@antfu/eslint-config'
620
+
importantfufrom'@pixpilot/eslint-config'
615
621
616
622
exportdefaultantfu({
617
623
react:true,
@@ -630,7 +636,7 @@ To enable Next.js support, you need to explicitly turn it on:
630
636
631
637
```js
632
638
// eslint.config.js
633
-
importantfufrom'@antfu/eslint-config'
639
+
importantfufrom'@pixpilot/eslint-config'
634
640
635
641
exportdefaultantfu({
636
642
nextjs:true,
@@ -649,7 +655,7 @@ To enable svelte support, you need to explicitly turn it on:
649
655
650
656
```js
651
657
// eslint.config.js
652
-
importantfufrom'@antfu/eslint-config'
658
+
importantfufrom'@pixpilot/eslint-config'
653
659
654
660
exportdefaultantfu({
655
661
svelte:true,
@@ -668,7 +674,7 @@ To enable astro support, you need to explicitly turn it on:
668
674
669
675
```js
670
676
// eslint.config.js
671
-
importantfufrom'@antfu/eslint-config'
677
+
importantfufrom'@pixpilot/eslint-config'
672
678
673
679
exportdefaultantfu({
674
680
astro:true,
@@ -687,7 +693,7 @@ To enable Solid support, you need to explicitly turn it on:
687
693
688
694
```js
689
695
// eslint.config.js
690
-
importantfufrom'@antfu/eslint-config'
696
+
importantfufrom'@pixpilot/eslint-config'
691
697
692
698
exportdefaultantfu({
693
699
solid:true,
@@ -706,7 +712,7 @@ To enable UnoCSS support, you need to explicitly turn it on:
706
712
707
713
```js
708
714
// eslint.config.js
709
-
importantfufrom'@antfu/eslint-config'
715
+
importantfufrom'@pixpilot/eslint-config'
710
716
711
717
exportdefaultantfu({
712
718
unocss:true,
@@ -763,7 +769,7 @@ You can optionally enable the [type aware rules](https://typescript-eslint.io/li
763
769
764
770
```js
765
771
// eslint.config.js
766
-
importantfufrom'@antfu/eslint-config'
772
+
importantfufrom'@pixpilot/eslint-config'
767
773
768
774
exportdefaultantfu({
769
775
typescript: {
@@ -786,7 +792,7 @@ This is to prevent unused imports from getting removed by the editor during refa
786
792
787
793
```js
788
794
// eslint.config.js
789
-
importantfufrom'@antfu/eslint-config'
795
+
importantfufrom'@pixpilot/eslint-config'
790
796
791
797
exportdefaultantfu({
792
798
isInEditor:false
@@ -879,7 +885,7 @@ I am a very opinionated person, so as this config. I prefer the top-level functi
879
885
I know they are not necessarily the popular opinions. If you really want to get rid of them, you can disable them with:
0 commit comments