@zayne-labs/eslint-config 0.3.0 → 0.4.0
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 +17 -22
- package/dist/chunk-VUNV25KB.js +14 -0
- package/dist/chunk-VUNV25KB.js.map +1 -0
- package/dist/dist-RQW5ZYTC.js +235156 -0
- package/dist/dist-RQW5ZYTC.js.map +1 -0
- package/dist/index.d.ts +4272 -967
- package/dist/index.js +372 -39
- package/dist/index.js.map +1 -1
- package/package.json +59 -41
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
- Requires ESLint v9.5.0+
|
|
10
10
|
- Inspired by the legendary open sourcerer, [antfu](https://github.com/antfu)
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
## Usage
|
|
14
13
|
|
|
15
14
|
### Manual Install
|
|
@@ -24,7 +23,7 @@ And create `eslint.config.js` in your project root:
|
|
|
24
23
|
|
|
25
24
|
```js
|
|
26
25
|
// eslint.config.js
|
|
27
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
26
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
28
27
|
|
|
29
28
|
export default zayne()
|
|
30
29
|
```
|
|
@@ -38,7 +37,7 @@ If you still use some configs from the legacy eslintrc format, you can use the [
|
|
|
38
37
|
|
|
39
38
|
```js
|
|
40
39
|
// eslint.config.mjs
|
|
41
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
40
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
42
41
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
43
42
|
|
|
44
43
|
const compat = new FlatCompat()
|
|
@@ -50,7 +49,7 @@ export default zayne(
|
|
|
50
49
|
|
|
51
50
|
// Legacy config
|
|
52
51
|
[
|
|
53
|
-
|
|
52
|
+
...compat.config({
|
|
54
53
|
extends: [
|
|
55
54
|
'eslint:recommended',
|
|
56
55
|
// Other extends...
|
|
@@ -199,7 +198,7 @@ Normally you only need to import the `zayne` preset:
|
|
|
199
198
|
|
|
200
199
|
```js
|
|
201
200
|
// eslint.config.js
|
|
202
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
201
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
203
202
|
|
|
204
203
|
export default zayne()
|
|
205
204
|
```
|
|
@@ -208,7 +207,7 @@ And that's it! Or you can configure each integration individually, for example:
|
|
|
208
207
|
|
|
209
208
|
```js
|
|
210
209
|
// eslint.config.js
|
|
211
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
210
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
212
211
|
|
|
213
212
|
export default zayne({
|
|
214
213
|
// Enable stylistic formatting rules
|
|
@@ -234,7 +233,7 @@ The `zayne` factory function also accepts an array of arbitrary custom config ov
|
|
|
234
233
|
|
|
235
234
|
```js
|
|
236
235
|
// eslint.config.js
|
|
237
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
236
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
238
237
|
|
|
239
238
|
export default zayne(
|
|
240
239
|
{
|
|
@@ -325,14 +324,13 @@ When you want to override rules, or disable them inline, you need to update to t
|
|
|
325
324
|
type foo = { bar: 2 }
|
|
326
325
|
```
|
|
327
326
|
|
|
328
|
-
|
|
329
327
|
<details>
|
|
330
328
|
<summary>Change back to original prefix</summary>
|
|
331
329
|
|
|
332
330
|
If you really want to use the original prefix, you can revert the plugin renaming by:
|
|
333
331
|
|
|
334
332
|
```ts
|
|
335
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
333
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
336
334
|
|
|
337
335
|
export default zayne()
|
|
338
336
|
.renamePlugins({
|
|
@@ -349,7 +347,7 @@ Certain rules would only be enabled in specific files, for example, `ts-eslint/*
|
|
|
349
347
|
|
|
350
348
|
```js
|
|
351
349
|
// eslint.config.js
|
|
352
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
350
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
353
351
|
|
|
354
352
|
export default zayne(
|
|
355
353
|
{
|
|
@@ -375,7 +373,7 @@ We also provided the `overrides` options in each integration to make it easier:
|
|
|
375
373
|
|
|
376
374
|
```js
|
|
377
375
|
// eslint.config.js
|
|
378
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
376
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
379
377
|
|
|
380
378
|
export default zayne({
|
|
381
379
|
react: {
|
|
@@ -402,7 +400,7 @@ The factory function `zayne()` returns a [`FlatConfigComposer` object from `esli
|
|
|
402
400
|
|
|
403
401
|
```js
|
|
404
402
|
// eslint.config.js
|
|
405
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
403
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
406
404
|
|
|
407
405
|
export default zayne()
|
|
408
406
|
.prepend(
|
|
@@ -425,14 +423,13 @@ export default zayne()
|
|
|
425
423
|
// ...
|
|
426
424
|
```
|
|
427
425
|
|
|
428
|
-
|
|
429
426
|
#### React
|
|
430
427
|
|
|
431
428
|
React support is auto-detected from installed dependencies. You can also explicitly turn it on:
|
|
432
429
|
|
|
433
430
|
```js
|
|
434
431
|
// eslint.config.js
|
|
435
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
432
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
436
433
|
|
|
437
434
|
export default zayne({
|
|
438
435
|
react: true,
|
|
@@ -451,7 +448,7 @@ To enable svelte support, you need to explicitly turn it on:
|
|
|
451
448
|
|
|
452
449
|
```js
|
|
453
450
|
// eslint.config.js
|
|
454
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
451
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
455
452
|
|
|
456
453
|
export default zayne({
|
|
457
454
|
svelte: true,
|
|
@@ -470,7 +467,7 @@ To enable astro support, you need to explicitly turn it on:
|
|
|
470
467
|
|
|
471
468
|
```js
|
|
472
469
|
// eslint.config.js
|
|
473
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
470
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
474
471
|
|
|
475
472
|
export default zayne({
|
|
476
473
|
astro: true,
|
|
@@ -489,7 +486,7 @@ To enable Solid support, you need to explicitly turn it on:
|
|
|
489
486
|
|
|
490
487
|
```js
|
|
491
488
|
// eslint.config.js
|
|
492
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
489
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
493
490
|
|
|
494
491
|
export default zayne({
|
|
495
492
|
solid: true,
|
|
@@ -508,7 +505,7 @@ To enable Tailwindcss support, you need to explicitly turn it on:
|
|
|
508
505
|
|
|
509
506
|
```js
|
|
510
507
|
// eslint.config.js
|
|
511
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
508
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
512
509
|
|
|
513
510
|
export default zayne({
|
|
514
511
|
tailwindcss: true,
|
|
@@ -521,14 +518,13 @@ Running `pnpm eslint` should prompt you to install the required dependencies, ot
|
|
|
521
518
|
pnpm i -D eslint-plugin-tailwindcss
|
|
522
519
|
```
|
|
523
520
|
|
|
524
|
-
|
|
525
521
|
### Type Aware Rules
|
|
526
522
|
|
|
527
523
|
You can optionally enable the [type aware rules](https://typescript-eslint.io/linting/typed-linting/) by passing the options object to the `typescript` config:
|
|
528
524
|
|
|
529
525
|
```js
|
|
530
526
|
// eslint.config.js
|
|
531
|
-
import zayne from '@zayne-labs/eslint-config'
|
|
527
|
+
import { zayne } from '@zayne-labs/eslint-config'
|
|
532
528
|
|
|
533
529
|
export default zayne({
|
|
534
530
|
typescript: {
|
|
@@ -537,7 +533,6 @@ export default zayne({
|
|
|
537
533
|
})
|
|
538
534
|
```
|
|
539
535
|
|
|
540
|
-
|
|
541
536
|
## View what rules are enabled
|
|
542
537
|
|
|
543
538
|
Eslint config inspecctor is visual tool to help you view what rules are enabled in your project and apply them to what files, [@eslint/config-inspector](https://github.com/eslint/config-inspector).
|
|
@@ -568,6 +563,6 @@ This project follows [Semantic Versioning](https://semver.org/) for releases. Ho
|
|
|
568
563
|
|
|
569
564
|
## FAQ
|
|
570
565
|
|
|
571
|
-
### I prefer XXX
|
|
566
|
+
### I prefer XXX
|
|
572
567
|
|
|
573
568
|
Sure, you can configure and override rules locally in your project to fit your needs. If that still does not work for you, you can always fork this repo and maintain your own.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { __commonJS, __require };
|
|
13
|
+
//# sourceMappingURL=chunk-VUNV25KB.js.map
|
|
14
|
+
//# sourceMappingURL=chunk-VUNV25KB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-VUNV25KB.js"}
|