@yunarch/config-web 0.2.7 β 0.3.1
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 -3
- package/dist/formatters/prettier.config.js +1 -1
- package/dist/linters/eslint.config.d.ts +46 -46
- package/dist/linters/eslint.config.js +1 -1
- package/dist/linters/oxlint.config.json +1 -1
- package/dist/ts/utils.d.ts +34 -0
- package/dist/ts/utils.js +1 -0
- package/package.json +19 -12
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
- [Enabling ESLint and Oxlint Simultaneously](#enabling-eslint-and-oxlint-simultaneously)
|
|
25
25
|
- [Oxlint](#oxlint)
|
|
26
26
|
- [π΅ Typescript](#-typescript)
|
|
27
|
+
- [ts-reset](#ts-reset)
|
|
28
|
+
- [Utilities](#utilities)
|
|
27
29
|
- [π§ CLI Tools](#-cli-tools)
|
|
28
30
|
- [π License](#-license)
|
|
29
31
|
|
|
@@ -42,7 +44,7 @@ This package provides ready-to-use configurations for:
|
|
|
42
44
|
|
|
43
45
|
- **Code Formatting:** Prettier, Biome
|
|
44
46
|
- **Linting:** ESLint, Oxlint
|
|
45
|
-
- **TypeScript:** Best-practice default config.
|
|
47
|
+
- **TypeScript:** Best-practice default config and utilities.
|
|
46
48
|
- **CLI Tools:** Useful command-line tools for streamlining workflows
|
|
47
49
|
|
|
48
50
|
> [!Tip]
|
|
@@ -290,7 +292,11 @@ Create the `tsconfig.json` file with the following content:
|
|
|
290
292
|
}
|
|
291
293
|
```
|
|
292
294
|
|
|
293
|
-
|
|
295
|
+
Learn more from [Typescript docs here](https://www.typescriptlang.org/tsconfig/#extends).
|
|
296
|
+
|
|
297
|
+
### ts-reset
|
|
298
|
+
|
|
299
|
+
This package also includes a [`ts-reset`](https://www.totaltypescript.com/ts-reset) configuration to enhance TypeScript's built-in types. To use it, create a `reset.d.ts` file in your project with the following content:
|
|
294
300
|
|
|
295
301
|
```ts
|
|
296
302
|
import '@yunarch/config-web/reset.d.ts';
|
|
@@ -310,7 +316,15 @@ Then, include this file in your `tsconfig.json`, for example:
|
|
|
310
316
|
> [!TIP]
|
|
311
317
|
> You can use a glob pattern like `"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]` to automatically include all relevant files, so you don't have to add them manually.
|
|
312
318
|
|
|
313
|
-
|
|
319
|
+
### Utilities
|
|
320
|
+
|
|
321
|
+
As an enhacement of `ts-reset` this package also includes utilities designed to help you write stricter and more maintainable code. TypeScript uses structural typing, which means it doesnβt always prevent objects from having excess properties. Unlike `ts-reset`, which modifies built-in types globally, these utilities are opt-in. Giving you control over when and where to enforce stricter typing.
|
|
322
|
+
|
|
323
|
+
To use them, simply import the desired utility from:
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
import { typedObjectEntries, typedObjectFromEntries, ... } from "@yunarch/config-web/ts-utils";
|
|
327
|
+
```
|
|
314
328
|
|
|
315
329
|
## π§ CLI Tools
|
|
316
330
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={printWidth:80,tabWidth:2,useTabs:!1,semi:!0,singleQuote:!0,arrowParens:"always",trailingComma:"es5",bracketSpacing:!0,bracketSameLine:!1,proseWrap:"preserve",endOfLine:"lf",quoteProps:"as-needed",singleAttributePerLine:!1,requirePragma:!1,insertPragma:!1,jsxSingleQuote:!1,htmlWhitespaceSensitivity:"css",embeddedLanguageFormatting:"auto",overrides:[{files:"**/*.jsonc",options:{trailingComma:"none"}},{files:"**/*.hbs",options:{parser:"html"}},{files:["**/package.json"],options:{useTabs:!1}},{files:["**/*.mdx"],options:{proseWrap:"preserve",htmlWhitespaceSensitivity:"ignore"}}]},
|
|
1
|
+
var e={printWidth:80,tabWidth:2,useTabs:!1,semi:!0,singleQuote:!0,arrowParens:"always",trailingComma:"es5",bracketSpacing:!0,bracketSameLine:!1,proseWrap:"preserve",endOfLine:"lf",quoteProps:"as-needed",singleAttributePerLine:!1,requirePragma:!1,insertPragma:!1,jsxSingleQuote:!1,htmlWhitespaceSensitivity:"css",embeddedLanguageFormatting:"auto",overrides:[{files:"**/*.jsonc",options:{trailingComma:"none"}},{files:"**/*.hbs",options:{parser:"html"}},{files:["**/package.json"],options:{useTabs:!1}},{files:["**/*.mdx"],options:{proseWrap:"preserve",htmlWhitespaceSensitivity:"ignore"}}]},i=e;export{e as config,i as default};
|
|
@@ -1479,233 +1479,233 @@ interface RuleOptions {
|
|
|
1479
1479
|
'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
1482
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1482
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/consistent-type-specifier-style.md
|
|
1483
1483
|
*/
|
|
1484
1484
|
'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
|
|
1485
1485
|
/**
|
|
1486
1486
|
* Ensure a default export is present, given a default import.
|
|
1487
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1487
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/default.md
|
|
1488
1488
|
*/
|
|
1489
1489
|
'import/default'?: Linter.RuleEntry<[]>
|
|
1490
1490
|
/**
|
|
1491
1491
|
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
1492
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1492
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/dynamic-import-chunkname.md
|
|
1493
1493
|
*/
|
|
1494
1494
|
'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
|
|
1495
1495
|
/**
|
|
1496
1496
|
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
1497
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1497
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/export.md
|
|
1498
1498
|
*/
|
|
1499
1499
|
'import/export'?: Linter.RuleEntry<[]>
|
|
1500
1500
|
/**
|
|
1501
1501
|
* Ensure all exports appear after other statements.
|
|
1502
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1502
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/exports-last.md
|
|
1503
1503
|
*/
|
|
1504
1504
|
'import/exports-last'?: Linter.RuleEntry<[]>
|
|
1505
1505
|
/**
|
|
1506
1506
|
* Ensure consistent use of file extension within the import path.
|
|
1507
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1507
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/extensions.md
|
|
1508
1508
|
*/
|
|
1509
1509
|
'import/extensions'?: Linter.RuleEntry<ImportExtensions>
|
|
1510
1510
|
/**
|
|
1511
1511
|
* Ensure all imports appear before other statements.
|
|
1512
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1512
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/first.md
|
|
1513
1513
|
*/
|
|
1514
1514
|
'import/first'?: Linter.RuleEntry<ImportFirst>
|
|
1515
1515
|
/**
|
|
1516
1516
|
* Prefer named exports to be grouped together in a single export declaration.
|
|
1517
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1517
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/group-exports.md
|
|
1518
1518
|
*/
|
|
1519
1519
|
'import/group-exports'?: Linter.RuleEntry<[]>
|
|
1520
1520
|
/**
|
|
1521
1521
|
* Replaced by `import-x/first`.
|
|
1522
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1522
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/imports-first.md
|
|
1523
1523
|
* @deprecated
|
|
1524
1524
|
*/
|
|
1525
1525
|
'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
|
|
1526
1526
|
/**
|
|
1527
1527
|
* Enforce the maximum number of dependencies a module can have.
|
|
1528
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1528
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/max-dependencies.md
|
|
1529
1529
|
*/
|
|
1530
1530
|
'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
|
|
1531
1531
|
/**
|
|
1532
1532
|
* Ensure named imports correspond to a named export in the remote file.
|
|
1533
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1533
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/named.md
|
|
1534
1534
|
*/
|
|
1535
1535
|
'import/named'?: Linter.RuleEntry<ImportNamed>
|
|
1536
1536
|
/**
|
|
1537
1537
|
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
1538
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1538
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/namespace.md
|
|
1539
1539
|
*/
|
|
1540
1540
|
'import/namespace'?: Linter.RuleEntry<ImportNamespace>
|
|
1541
1541
|
/**
|
|
1542
1542
|
* Enforce a newline after import statements.
|
|
1543
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1543
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/newline-after-import.md
|
|
1544
1544
|
*/
|
|
1545
1545
|
'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
|
|
1546
1546
|
/**
|
|
1547
1547
|
* Forbid import of modules using absolute paths.
|
|
1548
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1548
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-absolute-path.md
|
|
1549
1549
|
*/
|
|
1550
1550
|
'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
|
|
1551
1551
|
/**
|
|
1552
1552
|
* Forbid AMD `require` and `define` calls.
|
|
1553
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1553
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-amd.md
|
|
1554
1554
|
*/
|
|
1555
1555
|
'import/no-amd'?: Linter.RuleEntry<[]>
|
|
1556
1556
|
/**
|
|
1557
1557
|
* Forbid anonymous values as default exports.
|
|
1558
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1558
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-anonymous-default-export.md
|
|
1559
1559
|
*/
|
|
1560
1560
|
'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
|
|
1561
1561
|
/**
|
|
1562
1562
|
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
1563
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1563
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-commonjs.md
|
|
1564
1564
|
*/
|
|
1565
1565
|
'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
|
|
1566
1566
|
/**
|
|
1567
1567
|
* Forbid a module from importing a module with a dependency path back to itself.
|
|
1568
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1568
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-cycle.md
|
|
1569
1569
|
*/
|
|
1570
1570
|
'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
|
|
1571
1571
|
/**
|
|
1572
1572
|
* Forbid default exports.
|
|
1573
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1573
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-default-export.md
|
|
1574
1574
|
*/
|
|
1575
1575
|
'import/no-default-export'?: Linter.RuleEntry<[]>
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Forbid imported names marked with `@deprecated` documentation tag.
|
|
1578
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1578
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-deprecated.md
|
|
1579
1579
|
*/
|
|
1580
1580
|
'import/no-deprecated'?: Linter.RuleEntry<[]>
|
|
1581
1581
|
/**
|
|
1582
1582
|
* Forbid repeated import of the same module in multiple places.
|
|
1583
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1583
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-duplicates.md
|
|
1584
1584
|
*/
|
|
1585
1585
|
'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
|
|
1586
1586
|
/**
|
|
1587
1587
|
* Forbid `require()` calls with expressions.
|
|
1588
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1588
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-dynamic-require.md
|
|
1589
1589
|
*/
|
|
1590
1590
|
'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
|
|
1591
1591
|
/**
|
|
1592
1592
|
* Forbid empty named import blocks.
|
|
1593
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1593
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-empty-named-blocks.md
|
|
1594
1594
|
*/
|
|
1595
1595
|
'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
|
|
1596
1596
|
/**
|
|
1597
1597
|
* Forbid the use of extraneous packages.
|
|
1598
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1598
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-extraneous-dependencies.md
|
|
1599
1599
|
*/
|
|
1600
1600
|
'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
|
|
1601
1601
|
/**
|
|
1602
1602
|
* Forbid import statements with CommonJS module.exports.
|
|
1603
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1603
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-import-module-exports.md
|
|
1604
1604
|
*/
|
|
1605
1605
|
'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
|
|
1606
1606
|
/**
|
|
1607
1607
|
* Forbid importing the submodules of other modules.
|
|
1608
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1608
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-internal-modules.md
|
|
1609
1609
|
*/
|
|
1610
1610
|
'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
|
|
1611
1611
|
/**
|
|
1612
1612
|
* Forbid the use of mutable exports with `var` or `let`.
|
|
1613
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1613
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-mutable-exports.md
|
|
1614
1614
|
*/
|
|
1615
1615
|
'import/no-mutable-exports'?: Linter.RuleEntry<[]>
|
|
1616
1616
|
/**
|
|
1617
1617
|
* Forbid use of exported name as identifier of default export.
|
|
1618
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1618
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-named-as-default.md
|
|
1619
1619
|
*/
|
|
1620
1620
|
'import/no-named-as-default'?: Linter.RuleEntry<[]>
|
|
1621
1621
|
/**
|
|
1622
1622
|
* Forbid use of exported name as property of default export.
|
|
1623
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1623
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-named-as-default-member.md
|
|
1624
1624
|
*/
|
|
1625
1625
|
'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
|
|
1626
1626
|
/**
|
|
1627
1627
|
* Forbid named default exports.
|
|
1628
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1628
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-named-default.md
|
|
1629
1629
|
*/
|
|
1630
1630
|
'import/no-named-default'?: Linter.RuleEntry<[]>
|
|
1631
1631
|
/**
|
|
1632
1632
|
* Forbid named exports.
|
|
1633
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1633
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-named-export.md
|
|
1634
1634
|
*/
|
|
1635
1635
|
'import/no-named-export'?: Linter.RuleEntry<[]>
|
|
1636
1636
|
/**
|
|
1637
1637
|
* Forbid namespace (a.k.a. "wildcard" `*`) imports.
|
|
1638
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1638
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-namespace.md
|
|
1639
1639
|
*/
|
|
1640
1640
|
'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
|
|
1641
1641
|
/**
|
|
1642
1642
|
* Forbid Node.js builtin modules.
|
|
1643
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1643
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-nodejs-modules.md
|
|
1644
1644
|
*/
|
|
1645
1645
|
'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
|
|
1646
1646
|
/**
|
|
1647
1647
|
* Forbid importing packages through relative paths.
|
|
1648
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1648
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-relative-packages.md
|
|
1649
1649
|
*/
|
|
1650
1650
|
'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
|
|
1651
1651
|
/**
|
|
1652
1652
|
* Forbid importing modules from parent directories.
|
|
1653
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1653
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-relative-parent-imports.md
|
|
1654
1654
|
*/
|
|
1655
1655
|
'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
|
|
1656
1656
|
/**
|
|
1657
1657
|
* Forbid importing a default export by a different name.
|
|
1658
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1658
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-rename-default.md
|
|
1659
1659
|
*/
|
|
1660
1660
|
'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
|
|
1661
1661
|
/**
|
|
1662
1662
|
* Enforce which files can be imported in a given folder.
|
|
1663
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1663
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-restricted-paths.md
|
|
1664
1664
|
*/
|
|
1665
1665
|
'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
|
|
1666
1666
|
/**
|
|
1667
1667
|
* Forbid a module from importing itself.
|
|
1668
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1668
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-self-import.md
|
|
1669
1669
|
*/
|
|
1670
1670
|
'import/no-self-import'?: Linter.RuleEntry<[]>
|
|
1671
1671
|
/**
|
|
1672
1672
|
* Forbid unassigned imports.
|
|
1673
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1673
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-unassigned-import.md
|
|
1674
1674
|
*/
|
|
1675
1675
|
'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
|
|
1676
1676
|
/**
|
|
1677
1677
|
* Ensure imports point to a file/module that can be resolved.
|
|
1678
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1678
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-unresolved.md
|
|
1679
1679
|
*/
|
|
1680
1680
|
'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
|
|
1681
1681
|
/**
|
|
1682
1682
|
* Forbid modules without exports, or exports without matching import in another module.
|
|
1683
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1683
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-unused-modules.md
|
|
1684
1684
|
*/
|
|
1685
1685
|
'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
|
|
1686
1686
|
/**
|
|
1687
1687
|
* Forbid unnecessary path segments in import and require statements.
|
|
1688
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1688
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-useless-path-segments.md
|
|
1689
1689
|
*/
|
|
1690
1690
|
'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
|
|
1691
1691
|
/**
|
|
1692
1692
|
* Forbid webpack loader syntax in imports.
|
|
1693
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1693
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/no-webpack-loader-syntax.md
|
|
1694
1694
|
*/
|
|
1695
1695
|
'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
|
|
1696
1696
|
/**
|
|
1697
1697
|
* Enforce a convention in module import order.
|
|
1698
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1698
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/order.md
|
|
1699
1699
|
*/
|
|
1700
1700
|
'import/order'?: Linter.RuleEntry<ImportOrder>
|
|
1701
1701
|
/**
|
|
1702
1702
|
* Prefer a default export if module exports a single name or multiple names.
|
|
1703
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1703
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/prefer-default-export.md
|
|
1704
1704
|
*/
|
|
1705
1705
|
'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
|
|
1706
1706
|
/**
|
|
1707
1707
|
* Forbid potentially ambiguous parse goal (`script` vs. `module`).
|
|
1708
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.
|
|
1708
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.15.1/docs/rules/unambiguous.md
|
|
1709
1709
|
*/
|
|
1710
1710
|
'import/unambiguous'?: Linter.RuleEntry<[]>
|
|
1711
1711
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FlatConfigComposer as M}from"eslint-flat-config-utils";import C from"globals";import{default as v}from"@eslint/js";import{default as d}from"@vitest/eslint-plugin";import{default as j}from"eslint-config-prettier";import{default as b}from"eslint-plugin-import-x";import{default as f}from"eslint-plugin-jsdoc";import{default as k}from"eslint-plugin-oxlint";import{default as I}from"eslint-plugin-perfectionist";import{default as w}from"eslint-plugin-unicorn";import{default as S}from"eslint-plugin-unused-imports";import{default as m}from"typescript-eslint";function F(e={},r,t){let o=e.linterOptions??{};return[{name:"yunarch/base/ignores",ignores:["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*.md","**/LICENSE*",...r??[]]},{name:"yunarch/base/setup",languageOptions:{ecmaVersion:2022,globals:{...C.browser,...C.es2021,...C.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{...o,reportUnusedDisableDirectives:t?!1:o.reportUnusedDisableDirectives??!0}},{name:"yunarch/base/rules",plugins:{"unused-imports":S},rules:{...v.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error",camelcase:["error",{allow:["^UNSAFE_"],ignoreDestructuring:!1,properties:"never"}],curly:["error","multi-line","consistent"],"default-case-last":"error",eqeqeq:"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constant-binary-expression":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["error",{allow:["!!","+"]}],"no-implied-eval":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-param-reassign":"error","no-promise-executor-return":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-sequences":"error","no-template-curly-in-string":"error","no-undef-init":"warn","no-unneeded-ternary":"error","no-unreachable-loop":"error","no-unused-expressions":"error","no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-call":"error","no-useless-computed-key":"warn","no-useless-concat":"error","no-useless-rename":"warn","no-useless-return":"warn","no-var":"error","no-void":["error",{allowAsStatement:!0}],"object-shorthand":"warn","prefer-const":"warn","prefer-named-capture-group":"error","prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-regex-literals":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"warn","symbol-description":"error","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0,vars:"all",varsIgnorePattern:"^_"}],yoda:"warn"}}]}var y="**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",p="{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",_="**/*.d.{ts,cts,mts}",c="**/*.{ts,cts,mts}",u="**/*.{tsx,ctsx,mtsx}",x="**/*.astro/*.ts",h="**/*.md",P=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`];function E(e){let{oxlint:r}=e;return[{name:"yunarch/disables/cli",files:[`**/scripts/${y}`,`**/tasks/${y}`,`**/bin/${y}`,`**/bin.${p}`,`**/cli/${y}`,`**/cli.${p}`],rules:{"@typescript-eslint/no-floating-promises":"off","no-console":"off","unicorn/no-process-exit":"off"}},{name:"yunarch/disables/dts",files:[_],rules:{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off","no-restricted-syntax":"off","unused-imports/no-unused-vars":"off"}},{name:"yunarch/disables/config-files",files:[`**/*.config.${p}`,`**/*.config.*.${p}`],rules:{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}},{name:"yunarch/disables/prettier",rules:{...j.rules}},...r?.oxlintConfigPath?k.buildFromOxlintConfigFile(r.oxlintConfigPath):[]]}import{createTypeScriptImportResolver as J}from"eslint-import-resolver-typescript";import{createNodeResolver as K}from"eslint-plugin-import-x";function G(){return[{name:"yunarch/import/rules",plugins:{import:b},rules:{...b.flatConfigs.recommended.rules,"import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{ignoreExternal:!1,maxDepth:3}],"import/no-duplicates":["error",{"prefer-inline":!0}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-relative-packages":"error","import/no-self-import":"error","import/no-useless-path-segments":"error"},settings:{"import-x/resolver-next":[K()]}},{name:"yunarch/import/typescript/rules",files:[c,u],rules:{...b.flatConfigs.typescript.rules},settings:{"import-x/resolver-next":[J()]}}]}function L(){return[{name:"yunarch/jsdoc/rules",plugins:{jsdoc:f},rules:{...f.configs["flat/recommended-error"].rules,"jsdoc/check-param-names":["error",{checkDestructured:!1}],"jsdoc/lines-before-block":["error",{lines:0}],"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error","jsdoc/tag-lines":["error","any",{startLines:1}]}},{name:"yunarch/jsdoc/typescript/rules",files:[c,u],rules:{...f.configs["flat/recommended-typescript-error"].rules,...f.configs["flat/contents-typescript-error"].rules,...f.configs["flat/logical-typescript-error"].rules,...f.configs["flat/stylistic-typescript-error"].rules,"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error"}}]}function R(){return[{name:"yunarch/perfectionist/rules",plugins:{perfectionist:I},rules:{"perfectionist/sort-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-imports":["error",{groups:["builtin","external","internal",["parent","sibling","index"],"side-effect","object","unknown"],newlinesBetween:"never",order:"asc",type:"natural"}],"perfectionist/sort-named-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-named-imports":["error",{groupKind:"values-first",order:"asc",type:"natural"}],"import/order":"off","import-x/order":"off","sort-imports":"off"}}]}async function l(e){let r=await e;return typeof r=="object"&&r&&"default"in r?r.default:r}async function A(e){let[r,t,o]=await Promise.all([l(import("@eslint-react/eslint-plugin")),l(import("eslint-plugin-react-hooks")),l(import("eslint-plugin-react-refresh"))]),s=r.configs.all.plugins;return[{name:"yunarch/react/setup",plugins:{"@eslint-react":s["@eslint-react"],"@eslint-react/dom":s["@eslint-react/dom"],"@eslint-react/hooks-extra":s["@eslint-react/hooks-extra"],"@eslint-react/naming-convention":s["@eslint-react/naming-convention"],"@eslint-react/web-api":s["@eslint-react/web-api"],"react-hooks":t,"react-refresh":o}},{name:"yunarch/react/rules",files:[y],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:"module"},rules:{...r.configs.recommended.rules,...t.configs.recommended.rules,...o.configs.recommended.rules}},...e.isTypescriptEnabled?[{name:"yunarch/react/typescript/rules",files:[c,u],ignores:[`${h}/**`,x],languageOptions:{parserOptions:{projectService:!0}},rules:{...r.configs["recommended-typescript"].rules,...e.isTypeAware?{...r.configs["recommended-type-checked"].rules}:{}}}]:[]]}async function B(e){let r=e===!0||e.enableQuery,t=e===!0||e.enableRouter,o=[];if(r){let s=await l(import("@tanstack/eslint-plugin-query"));o.push({name:"yunarch/tanstack/query/rules",plugins:{"@tanstack/query":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}if(t){let s=await l(import("@tanstack/eslint-plugin-router"));o.push({name:"yunarch/tanstack/router/rules",plugins:{"@tanstack/router":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}return o}function D(e){let{enableTypeTesting:r}=e;return[{name:"yunarch/test/setup",plugins:{vitest:d},...r?{settings:{vitest:{typecheck:!0}},languageOptions:{globals:{...d.environments.env.globals}}}:{}},{name:"yunarch/test/rules",files:[...P],rules:{...d.configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}}]}function N(e,r,t){return{name:e,files:r,...t.ignores?{ignores:t.ignores}:{},languageOptions:{parser:m.parser,parserOptions:{extraFileExtensions:t.extraFileExtensions?.map(o=>`.${o}`),sourceType:"module",...t.tsconfigPath?{projectService:{allowDefaultProject:["./*.js"],defaultProject:t.tsconfigPath},tsconfigRootDir:process.cwd()}:{},...t.parserOptions}}}}function $(e,r=[]){let t=[c,u],o=e.filesTypeAware??[c,u],s=e.ignoresTypeAware??[`${h}/**`,x];return[{name:"yunarch/typescript/setup",plugins:{"@typescript-eslint":m.plugin}},N("yunarch/typescript/parser",t,{ignores:void 0,extraFileExtensions:r,parserOptions:e.parserOptions}),...e.tsconfigPath?[N("yunarch/typescript/parser/type-aware",o,{ignores:s,extraFileExtensions:r,parserOptions:e.parserOptions,tsconfigPath:e.tsconfigPath})]:[],{name:"yunarch/typescript/rules",files:t,rules:{...m.configs.eslintRecommended.rules,...m.configs.strict.at(-1)?.rules,...m.configs.stylistic.at(-1)?.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"separate-type-imports",prefer:"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/naming-convention":["error",{format:["PascalCase"],selector:["typeLike"]},{format:["UPPER_CASE"],selector:["enumMember"]},{custom:{match:!1,regex:"^I[A-Z]|^(Interface|Props|State)$"},format:["PascalCase"],selector:"interface"}],"@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-loop-func":"error","@typescript-eslint/no-redeclare":["error",{builtinGlobals:!1}],"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-empty-export":"warn","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0,ignoreOverloadsWithDifferentJSDoc:!0}]}},...e.tsconfigPath&&!e.disableTypeAware?[{name:"yunarch/typescript/rules/type-aware",files:o,ignores:s,rules:{...m.configs.strictTypeCheckedOnly.at(-1)?.rules,...m.configs.stylisticTypeCheckedOnly.at(-1)?.rules,"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/switch-exhaustiveness-check":"warn"}}]:[]]}function q(){return[{name:"yunarch/unicorn/rules",plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":["error",{cases:{camelCase:!0,kebabCase:!0,pascalCase:!0}}],"unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/prefer-number-properties":["error",{checkInfinity:!0,checkNaN:!0}],"unicorn/prefer-top-level-await":"warn","unicorn/prevent-abbreviations":"off"}}]}function Q(e={},...r){let{gitignore:t=!0,ignores:o,extraFileExtensions:s,import:U=!0,jsdoc:X=!0,unicorn:V=!0,oxlint:O}=e,W=!!O,a=[];t&&(typeof t=="boolean"?a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",strict:!1})])):a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",...t})]))),a.push(F(e.base,o,W)),e.typescript&&a.push($(e.typescript===!0?{}:e.typescript,s)),U&&a.push(G()),X&&a.push(L()),V&&a.push(q()),e.test&&a.push(D(e.test===!0?{}:e.test)),e.tanstack&&a.push(B(e.tanstack)),e.react&&a.push(A({isTypescriptEnabled:!!e.typescript,isTypeAware:typeof e.typescript=="object"&&!!e.typescript.tsconfigPath&&!e.typescript.disableTypeAware})),a.push(R(),E({oxlint:O}));let g=new M;return g=g.append(...a,...r),g=g.renamePlugins({"import-x":"import"}),g}export{Q as config};
|
|
1
|
+
import{FlatConfigComposer as M}from"eslint-flat-config-utils";import C from"globals";import{default as v}from"@eslint/js";import{default as d}from"@vitest/eslint-plugin";import{default as j}from"eslint-config-prettier";import{default as b}from"eslint-plugin-import-x";import{default as f}from"eslint-plugin-jsdoc";import{default as k}from"eslint-plugin-oxlint";import{default as I}from"eslint-plugin-perfectionist";import{default as w}from"eslint-plugin-unicorn";import{default as S}from"eslint-plugin-unused-imports";import{default as m}from"typescript-eslint";function F(e={},r,t){let o=e.linterOptions??{};return[{name:"yunarch/base/ignores",ignores:["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*.md","**/LICENSE*",...r??[]]},{name:"yunarch/base/setup",languageOptions:{ecmaVersion:2022,globals:{...C.browser,...C.es2021,...C.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{...o,reportUnusedDisableDirectives:t?!1:o.reportUnusedDisableDirectives??!0}},{name:"yunarch/base/rules",plugins:{"unused-imports":S},rules:{...v.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error",camelcase:["error",{allow:["^UNSAFE_"],ignoreDestructuring:!1,properties:"never"}],curly:["error","multi-line","consistent"],"default-case-last":"error",eqeqeq:"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constant-binary-expression":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["error",{allow:["!!","+"]}],"no-implied-eval":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-param-reassign":"error","no-promise-executor-return":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-sequences":"error","no-template-curly-in-string":"error","no-undef-init":"warn","no-unneeded-ternary":"error","no-unreachable-loop":"error","no-unused-expressions":"error","no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-call":"error","no-useless-computed-key":"warn","no-useless-concat":"error","no-useless-rename":"warn","no-useless-return":"warn","no-var":"error","no-void":["error",{allowAsStatement:!0}],"object-shorthand":"warn","prefer-const":"warn","prefer-named-capture-group":"error","prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-regex-literals":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"warn","symbol-description":"error","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0,vars:"all",varsIgnorePattern:"^_"}],yoda:"warn"}}]}var y="**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",p="{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",_="**/*.d.{ts,cts,mts}",c="**/*.{ts,cts,mts}",u="**/*.{tsx,ctsx,mtsx}",x="**/*.astro/*.ts",h="**/*.md",P=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`];function E(e){let{oxlint:r}=e;return[{name:"yunarch/disables/cli",files:[`**/scripts/${y}`,`**/tasks/${y}`,`**/bin/${y}`,`**/bin.${p}`,`**/cli/${y}`,`**/cli.${p}`],rules:{"@typescript-eslint/no-floating-promises":"off","no-console":"off","unicorn/no-process-exit":"off"}},{name:"yunarch/disables/dts",files:[_],rules:{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off","no-restricted-syntax":"off","unused-imports/no-unused-vars":"off"}},{name:"yunarch/disables/config-files",files:[`**/*.config.${p}`,`**/*.config.*.${p}`],rules:{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}},{name:"yunarch/disables/prettier",rules:{...j.rules}},...r?.oxlintConfigPath?k.buildFromOxlintConfigFile(r.oxlintConfigPath):[]]}import{createTypeScriptImportResolver as J}from"eslint-import-resolver-typescript";import{createNodeResolver as K}from"eslint-plugin-import-x";function G(){return[{name:"yunarch/import/rules",plugins:{import:b},rules:{...b.flatConfigs.recommended.rules,"import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{ignoreExternal:!1,maxDepth:3}],"import/no-duplicates":["error",{"prefer-inline":!0}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-relative-packages":"error","import/no-self-import":"error","import/no-useless-path-segments":"error"},settings:{"import-x/resolver-next":[K()]}},{name:"yunarch/import/typescript/rules",files:[c,u],rules:{...b.flatConfigs.typescript.rules},settings:{"import-x/resolver-next":[J()]}}]}function L(){return[{name:"yunarch/jsdoc/rules",plugins:{jsdoc:f},rules:{...f.configs["flat/recommended-error"].rules,"jsdoc/check-param-names":["error",{checkDestructured:!1}],"jsdoc/lines-before-block":["error",{lines:0}],"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error","jsdoc/tag-lines":["error","any",{startLines:1}]}},{name:"yunarch/jsdoc/typescript/rules",files:[c,u],rules:{...f.configs["flat/recommended-typescript-error"].rules,...f.configs["flat/contents-typescript-error"].rules,...f.configs["flat/logical-typescript-error"].rules,...f.configs["flat/stylistic-typescript-error"].rules,"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error"}}]}function R(){return[{name:"yunarch/perfectionist/rules",plugins:{perfectionist:I},rules:{"perfectionist/sort-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-imports":["error",{groups:["builtin","external","internal",["parent","sibling","index"],"side-effect","object","unknown"],newlinesBetween:"never",order:"asc",type:"natural"}],"perfectionist/sort-named-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-named-imports":["error",{groupKind:"values-first",order:"asc",type:"natural"}],"import/order":"off","import-x/order":"off","sort-imports":"off"}}]}async function l(e){let r=await e;return typeof r=="object"&&r&&"default"in r?r.default:r}async function A(e){let[r,t,o]=await Promise.all([l(import("@eslint-react/eslint-plugin")),l(import("eslint-plugin-react-hooks")),l(import("eslint-plugin-react-refresh"))]),s=r.configs.all.plugins;return[{name:"yunarch/react/setup",plugins:{"@eslint-react":s["@eslint-react"],"@eslint-react/dom":s["@eslint-react/dom"],"@eslint-react/hooks-extra":s["@eslint-react/hooks-extra"],"@eslint-react/naming-convention":s["@eslint-react/naming-convention"],"@eslint-react/web-api":s["@eslint-react/web-api"],"react-hooks":t,"react-refresh":o}},{name:"yunarch/react/rules",files:[y],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:"module"},rules:{...r.configs.recommended.rules,...t.configs.recommended.rules,...o.configs.recommended.rules}},...e.isTypescriptEnabled?[{name:"yunarch/react/typescript/rules",files:[c,u],ignores:[`${h}/**`,x],languageOptions:{parserOptions:{projectService:!0}},rules:{...r.configs["recommended-typescript"].rules,...e.isTypeAware?{...r.configs["recommended-type-checked"].rules}:{}}}]:[]]}async function B(e){let r=e===!0||e.enableQuery,t=e===!0||e.enableRouter,o=[];if(r){let s=await l(import("@tanstack/eslint-plugin-query"));o.push({name:"yunarch/tanstack/query/rules",plugins:{"@tanstack/query":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}if(t){let s=await l(import("@tanstack/eslint-plugin-router"));o.push({name:"yunarch/tanstack/router/rules",plugins:{"@tanstack/router":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}return o}function D(e){let{enableTypeTesting:r}=e;return[{name:"yunarch/test/setup",plugins:{vitest:d},...r?{settings:{vitest:{typecheck:!0}},languageOptions:{globals:{...d.environments.env.globals}}}:{}},{name:"yunarch/test/rules",files:[...P],rules:{...d.configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}}]}function N(e,r,t){return{name:e,files:r,...t.ignores?{ignores:t.ignores}:{},languageOptions:{parser:m.parser,parserOptions:{extraFileExtensions:t.extraFileExtensions?.map(o=>`.${o}`),sourceType:"module",...t.tsconfigPath?{projectService:{allowDefaultProject:["./*.js"],defaultProject:t.tsconfigPath},tsconfigRootDir:process.cwd()}:{},...t.parserOptions}}}}function $(e,r=[]){let t=[c,u],o=e.filesTypeAware??[c,u],s=e.ignoresTypeAware??[`${h}/**`,x];return[{name:"yunarch/typescript/setup",plugins:{"@typescript-eslint":m.plugin}},N("yunarch/typescript/parser",t,{ignores:void 0,extraFileExtensions:r,parserOptions:e.parserOptions}),...e.tsconfigPath?[N("yunarch/typescript/parser/type-aware",o,{ignores:s,extraFileExtensions:r,parserOptions:e.parserOptions,tsconfigPath:e.tsconfigPath})]:[],{name:"yunarch/typescript/rules",files:t,rules:{...m.configs.eslintRecommended.rules,...m.configs.strict.at(-1)?.rules,...m.configs.stylistic.at(-1)?.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports",prefer:"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/naming-convention":["error",{format:["PascalCase"],selector:["typeLike"]},{format:["UPPER_CASE"],selector:["enumMember"]},{custom:{match:!1,regex:"^I[A-Z]|^(Interface|Props|State)$"},format:["PascalCase"],selector:"interface"}],"@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-loop-func":"error","@typescript-eslint/no-redeclare":["error",{builtinGlobals:!1}],"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-empty-export":"warn","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0,ignoreOverloadsWithDifferentJSDoc:!0}]}},...e.tsconfigPath&&!e.disableTypeAware?[{name:"yunarch/typescript/rules/type-aware",files:o,ignores:s,rules:{...m.configs.strictTypeCheckedOnly.at(-1)?.rules,...m.configs.stylisticTypeCheckedOnly.at(-1)?.rules,"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/switch-exhaustiveness-check":"warn"}}]:[]]}function q(){return[{name:"yunarch/unicorn/rules",plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":["error",{cases:{camelCase:!0,kebabCase:!0,pascalCase:!0}}],"unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/prefer-number-properties":["error",{checkInfinity:!0,checkNaN:!0}],"unicorn/prefer-top-level-await":"warn","unicorn/prevent-abbreviations":"off"}}]}function Q(e={},...r){let{gitignore:t=!0,ignores:o,extraFileExtensions:s,import:U=!0,jsdoc:X=!0,unicorn:V=!0,oxlint:O}=e,W=!!O,a=[];t&&(typeof t=="boolean"?a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",strict:!1})])):a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",...t})]))),a.push(F(e.base,o,W)),e.typescript&&a.push($(e.typescript===!0?{}:e.typescript,s)),U&&a.push(G()),X&&a.push(L()),V&&a.push(q()),e.test&&a.push(D(e.test===!0?{}:e.test)),e.tanstack&&a.push(B(e.tanstack)),e.react&&a.push(A({isTypescriptEnabled:!!e.typescript,isTypeAware:typeof e.typescript=="object"&&!!e.typescript.tsconfigPath&&!e.typescript.disableTypeAware})),a.push(R(),E({oxlint:O}));let g=new M;return g=g.append(...a,...r),g=g.renamePlugins({"import-x":"import"}),g}export{Q as config};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"ignorePatterns":["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*.md","**/LICENSE*"],"plugins":["eslint","typescript","import","jsdoc","unicorn","vitest","react"],"rules":{"for-direction":"error","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-const-assign":"error","no-constant-binary-expression":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":"error","no-empty-character-class":"error","no-empty-pattern":"error","no-empty-static-block":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-loss-of-precision":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-unexpected-multiline":0,"no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-labels":"error","no-unused-private-class-members":"error","no-unused-vars":["error",{"args":"none","caughtErrors":"none","ignoreRestSiblings":true,"vars":"all"}],"no-useless-backreference":"error","no-useless-catch":"error","no-useless-escape":"error","no-with":"error","require-yield":"error","use-isnan":"error","valid-typeof":"error","array-callback-return":["error",{"allowImplicit":true}],"block-scoped-var":"error","curly":0,"default-case-last":"error","eqeqeq":"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{"capIsNew":false}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-label":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"off","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-unneeded-ternary":"error","no-unused-expressions":"error","no-useless-call":"error","no-useless-concat":"error","no-useless-rename":"warn","no-var":"error","no-void":["error",{"allowAsStatement":true}],"prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{"allowEmptyReject":true}],"prefer-rest-params":"error","prefer-spread":"error","symbol-description":"error","yoda":"warn","import/namespace":"error","import/default":"error","import/no-named-as-default":"warn","import/no-named-as-default-member":"warn","import/no-duplicates":["error",{"prefer-inline":true}],"import/first":"error","import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{"ignoreExternal":false,"maxDepth":3}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-self-import":"error","jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"error","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"error","jsdoc/require-yields":"error","no-negated-condition":"off","unicorn/catch-error-name":"error","unicorn/consistent-assert":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/empty-brace-spaces":"off","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/filename-case":["error",{"cases":{"camelCase":true,"kebabCase":true,"pascalCase":true}}],"unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-accessor-recursion":"error","unicorn/no-anonymous-default-export":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-array-reduce":"off","unicorn/no-await-expression-member":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-document-cookie":"error","unicorn/no-empty-file":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-magic-array-flat-depth":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-nested-ternary":"off","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-null":"off","unicorn/no-object-as-default-parameter":"error","unicorn/no-process-exit":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-thenable":"error","unicorn/no-this-assignment":"error","unicorn/no-typeof-undefined":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-unreadable-array-destructuring":"error","unicorn/no-unreadable-iife":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-useless-undefined":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"off","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-event-target":"error","unicorn/prefer-global-this":"error","unicorn/prefer-includes":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-native-coercion-functions":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":["error",{"checkInfinity":true,"checkNaN":true}],"unicorn/prefer-object-from-entries":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-has":"error","unicorn/prefer-set-size":"error","unicorn/prefer-spread":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-type-error":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/require-post-message-target-origin":"off","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error","sort-imports":"off"},"overrides":[{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-class-assign":"off","no-const-assign":"off","no-dupe-class-members":"off","no-dupe-keys":"off","no-func-assign":"off","no-import-assign":"off","no-new-native-nonconstructor":"off","no-obj-calls":"off","no-redeclare":"off","no-setter-return":"off","no-this-before-super":"off","no-unsafe-negation":"off","no-var":"error","no-with":"off","prefer-rest-params":"error","prefer-spread":"error","@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"error","@typescript-eslint/no-empty-object-type":["error",{"allowInterfaces":"always"}],"@typescript-eslint/no-explicit-any":"error","@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-extraneous-class":"error","@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-asserted-nullish-coalescing":"error","@typescript-eslint/no-non-null-asserted-optional-chain":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-this-alias":"error","@typescript-eslint/no-unnecessary-type-constraint":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/no-unsafe-function-type":"error","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"error","@typescript-eslint/prefer-literal-enum-member":"error","@typescript-eslint/prefer-namespace-keyword":"error","@typescript-eslint/triple-slash-reference":"error","@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":"error","@typescript-eslint/ban-tslint-comment":"error","@typescript-eslint/consistent-generic-constructors":"error","@typescript-eslint/consistent-indexed-object-style":"error","@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/no-confusing-non-null-assertion":"error","no-empty-function":"off","@typescript-eslint/no-empty-function":"error","@typescript-eslint/no-inferrable-types":"error","@typescript-eslint/prefer-for-of":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/consistent-type-imports":["error",{"disallowTypeAnnotations":false,"fixStyle":"separate-type-imports","prefer":"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@typescript-eslint/no-useless-empty-export":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-throw-literal":"off","prefer-promise-reject-errors":"off","require-await":"off"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"off","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"off","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"off","jsdoc/require-yields":"error"}},{"files":["**/__tests__/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.spec.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.test.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.bench.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.benchmark.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"vitest/expect-expect":"error","vitest/no-identical-title":"error","vitest/no-commented-out-tests":"error","vitest/valid-expect":"error","vitest/valid-describe-callback":"error","vitest/require-local-test-context-for-concurrent-snapshots":"error","vitest/no-import-node-test":"error","vitest/consistent-test-it":["error",{"fn":"it","withinDescribe":"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}},{"files":["**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"react/jsx-no-duplicate-props":"warn","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"react/jsx-no-duplicate-props":"off","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error"}},{"files":["**/scripts/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/tasks/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","unicorn/no-process-exit":"off"}},{"files":["**/*.d.{ts,cts,mts}"],"rules":{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off"}},{"files":["**/*.config.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.config.*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}}]}
|
|
1
|
+
{"ignorePatterns":["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*.md","**/LICENSE*"],"plugins":["eslint","typescript","import","jsdoc","unicorn","vitest","react"],"rules":{"for-direction":"error","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-const-assign":"error","no-constant-binary-expression":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":"error","no-empty-character-class":"error","no-empty-pattern":"error","no-empty-static-block":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-loss-of-precision":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-unexpected-multiline":0,"no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-labels":"error","no-unused-private-class-members":"error","no-unused-vars":["error",{"args":"none","caughtErrors":"none","ignoreRestSiblings":true,"vars":"all"}],"no-useless-backreference":"error","no-useless-catch":"error","no-useless-escape":"error","no-with":"error","require-yield":"error","use-isnan":"error","valid-typeof":"error","array-callback-return":["error",{"allowImplicit":true}],"block-scoped-var":"error","curly":0,"default-case-last":"error","eqeqeq":"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{"capIsNew":false}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-label":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"off","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-unneeded-ternary":"error","no-unused-expressions":"error","no-useless-call":"error","no-useless-concat":"error","no-useless-rename":"warn","no-var":"error","no-void":["error",{"allowAsStatement":true}],"prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{"allowEmptyReject":true}],"prefer-rest-params":"error","prefer-spread":"error","symbol-description":"error","yoda":"warn","import/namespace":"error","import/default":"error","import/no-named-as-default":"warn","import/no-named-as-default-member":"warn","import/no-duplicates":["error",{"prefer-inline":true}],"import/first":"error","import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{"ignoreExternal":false,"maxDepth":3}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-self-import":"error","jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"error","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"error","jsdoc/require-yields":"error","no-negated-condition":"off","unicorn/catch-error-name":"error","unicorn/consistent-assert":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/empty-brace-spaces":"off","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/filename-case":["error",{"cases":{"camelCase":true,"kebabCase":true,"pascalCase":true}}],"unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-accessor-recursion":"error","unicorn/no-anonymous-default-export":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-array-reduce":"off","unicorn/no-await-expression-member":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-document-cookie":"error","unicorn/no-empty-file":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-magic-array-flat-depth":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-nested-ternary":"off","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-null":"off","unicorn/no-object-as-default-parameter":"error","unicorn/no-process-exit":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-thenable":"error","unicorn/no-this-assignment":"error","unicorn/no-typeof-undefined":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-unreadable-array-destructuring":"error","unicorn/no-unreadable-iife":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-useless-undefined":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"off","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-event-target":"error","unicorn/prefer-global-this":"error","unicorn/prefer-includes":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-native-coercion-functions":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":["error",{"checkInfinity":true,"checkNaN":true}],"unicorn/prefer-object-from-entries":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-has":"error","unicorn/prefer-set-size":"error","unicorn/prefer-spread":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-type-error":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/require-post-message-target-origin":"off","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error","sort-imports":"off"},"overrides":[{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-class-assign":"off","no-const-assign":"off","no-dupe-class-members":"off","no-dupe-keys":"off","no-func-assign":"off","no-import-assign":"off","no-new-native-nonconstructor":"off","no-obj-calls":"off","no-redeclare":"off","no-setter-return":"off","no-this-before-super":"off","no-unsafe-negation":"off","no-var":"error","no-with":"off","prefer-rest-params":"error","prefer-spread":"error","@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"error","@typescript-eslint/no-empty-object-type":["error",{"allowInterfaces":"always"}],"@typescript-eslint/no-explicit-any":"error","@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-extraneous-class":"error","@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-asserted-nullish-coalescing":"error","@typescript-eslint/no-non-null-asserted-optional-chain":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-this-alias":"error","@typescript-eslint/no-unnecessary-type-constraint":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/no-unsafe-function-type":"error","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"error","@typescript-eslint/prefer-literal-enum-member":"error","@typescript-eslint/prefer-namespace-keyword":"error","@typescript-eslint/triple-slash-reference":"error","@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":"error","@typescript-eslint/ban-tslint-comment":"error","@typescript-eslint/consistent-generic-constructors":"error","@typescript-eslint/consistent-indexed-object-style":"error","@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/no-confusing-non-null-assertion":"error","no-empty-function":"off","@typescript-eslint/no-empty-function":"error","@typescript-eslint/no-inferrable-types":"error","@typescript-eslint/prefer-for-of":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/consistent-type-imports":["error",{"disallowTypeAnnotations":false,"fixStyle":"inline-type-imports","prefer":"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@typescript-eslint/no-useless-empty-export":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-throw-literal":"off","prefer-promise-reject-errors":"off","require-await":"off"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"off","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"off","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"off","jsdoc/require-yields":"error"}},{"files":["**/__tests__/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.spec.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.test.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.bench.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.benchmark.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"vitest/expect-expect":"error","vitest/no-identical-title":"error","vitest/no-commented-out-tests":"error","vitest/valid-expect":"error","vitest/valid-describe-callback":"error","vitest/require-local-test-context-for-concurrent-snapshots":"error","vitest/no-import-node-test":"error","vitest/consistent-test-it":["error",{"fn":"it","withinDescribe":"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}},{"files":["**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"react/jsx-no-duplicate-props":"warn","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"react/jsx-no-duplicate-props":"off","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error"}},{"files":["**/scripts/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/tasks/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","unicorn/no-process-exit":"off"}},{"files":["**/*.d.{ts,cts,mts}"],"rules":{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off"}},{"files":["**/*.config.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.config.*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}}]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Prettify<T> = {
|
|
2
|
+
[K in keyof T]: T[K];
|
|
3
|
+
} & {};
|
|
4
|
+
type ObjectEntry<Base> = [keyof Base, Base[keyof Base]];
|
|
5
|
+
type ArrayEntry<Base extends readonly unknown[]> = [number, Base[number]];
|
|
6
|
+
type SetEntry<Base> = Base extends Set<infer V> ? [V, V] : never;
|
|
7
|
+
type MapEntry<Base> = Base extends Map<infer K, infer V> ? [K, V] : never;
|
|
8
|
+
type Entry<BaseType> = BaseType extends Map<unknown, unknown> ? MapEntry<BaseType> : BaseType extends Set<unknown> ? SetEntry<BaseType> : BaseType extends readonly unknown[] ? ArrayEntry<BaseType> : BaseType extends object ? ObjectEntry<BaseType> : never;
|
|
9
|
+
/**
|
|
10
|
+
* Utility function to have a type-safety alternative to Object.entries.
|
|
11
|
+
*
|
|
12
|
+
* @param obj - The object to create entries from.
|
|
13
|
+
* @returns Object entries with typed keys and values.
|
|
14
|
+
*/
|
|
15
|
+
declare function typedObjectEntries<T extends object>(obj: T): Entry<T>[];
|
|
16
|
+
type IsUnion<T, U extends T = T> = T extends unknown ? [U] extends [T] ? false : true : false;
|
|
17
|
+
type IfUnion<T, Yes, No> = true extends IsUnion<T> ? Yes : No;
|
|
18
|
+
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
19
|
+
type InferKeyOptionalityFromTupleType<T extends readonly [PropertyKey, unknown]> = UnionToIntersection<T extends [unknown, unknown] ? {
|
|
20
|
+
[K in T[0]]?: unknown;
|
|
21
|
+
} : IfUnion<T[0], {
|
|
22
|
+
[K in T[0]]?: unknown;
|
|
23
|
+
}, {
|
|
24
|
+
[K in T[0]]: unknown;
|
|
25
|
+
}>>;
|
|
26
|
+
/**
|
|
27
|
+
* Utility function to have a type-safe alternative to Object.fromEntries.
|
|
28
|
+
*
|
|
29
|
+
* @param entries - The entries to create an object from.
|
|
30
|
+
* @returns An object with typed keys and values based on the provided entries.
|
|
31
|
+
*/
|
|
32
|
+
declare function typedObjectFromEntries<T extends readonly [...(readonly (readonly [PropertyKey, unknown])[])]>(entries: T): T extends [...T[number][]] ? { [K in T[number][0]]?: (readonly [K, T[number][1]] & T[number])[1]; } : { [K in keyof InferKeyOptionalityFromTupleType<T[number]>]: (readonly [K, T[number][1]] & T[number])[1]; };
|
|
33
|
+
|
|
34
|
+
export { type Prettify, typedObjectEntries, typedObjectFromEntries };
|
package/dist/ts/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(e){return Object.entries(e)}function y(e){return Object.fromEntries(e)}export{r as typedObjectEntries,y as typedObjectFromEntries};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"name": "@yunarch/config-web",
|
|
5
5
|
"description": "Shared configurations for web projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,11 +38,18 @@
|
|
|
38
38
|
"exports": {
|
|
39
39
|
".": "./dist/index.js",
|
|
40
40
|
"./prettier": "./dist/formatters/prettier.config.js",
|
|
41
|
-
"./eslint":
|
|
41
|
+
"./eslint": {
|
|
42
|
+
"types": "./dist/linters/eslint.config.d.ts",
|
|
43
|
+
"default": "./dist/linters/eslint.config.js"
|
|
44
|
+
},
|
|
42
45
|
"./oxlint": "./dist/linters/oxlint.config.json",
|
|
43
46
|
"./biome-formatter": "./dist/formatters/biome.config.json",
|
|
44
47
|
"./tsconfig-base": "./dist/ts/tsconfig-base.json",
|
|
45
|
-
"./reset.d.ts": "./dist/ts/reset.d.ts"
|
|
48
|
+
"./reset.d.ts": "./dist/ts/reset.d.ts",
|
|
49
|
+
"./ts-utils": {
|
|
50
|
+
"types": "./dist/ts/utils.d.ts",
|
|
51
|
+
"default": "./dist/ts/utils.js"
|
|
52
|
+
}
|
|
46
53
|
},
|
|
47
54
|
"type": "module",
|
|
48
55
|
"scripts": {
|
|
@@ -92,21 +99,21 @@
|
|
|
92
99
|
"globals": "16.2.0",
|
|
93
100
|
"eslint-flat-config-utils": "2.1.0",
|
|
94
101
|
"eslint-config-flat-gitignore": "2.1.0",
|
|
95
|
-
"eslint-import-resolver-typescript": "4.4.
|
|
102
|
+
"eslint-import-resolver-typescript": "4.4.3",
|
|
96
103
|
"@eslint/js": "9.28.0",
|
|
97
|
-
"typescript-eslint": "8.
|
|
104
|
+
"typescript-eslint": "8.34.0",
|
|
98
105
|
"eslint-plugin-unicorn": "59.0.1",
|
|
99
106
|
"eslint-plugin-perfectionist": "4.14.0",
|
|
100
|
-
"eslint-plugin-import-x": "4.15.
|
|
107
|
+
"eslint-plugin-import-x": "4.15.1",
|
|
101
108
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
102
109
|
"eslint-plugin-jsdoc": "50.7.1",
|
|
103
110
|
"eslint-config-prettier": "10.1.5",
|
|
104
|
-
"eslint-plugin-oxlint": "0.
|
|
105
|
-
"@eslint-react/eslint-plugin": "1.51.
|
|
111
|
+
"eslint-plugin-oxlint": "0.18.1",
|
|
112
|
+
"@eslint-react/eslint-plugin": "1.51.3",
|
|
106
113
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
107
114
|
"eslint-plugin-react-refresh": "0.4.20",
|
|
108
115
|
"@tanstack/eslint-plugin-query": "5.78.0",
|
|
109
|
-
"@tanstack/eslint-plugin-router": "1.
|
|
116
|
+
"@tanstack/eslint-plugin-router": "1.120.17",
|
|
110
117
|
"@vitest/eslint-plugin": "1.2.1"
|
|
111
118
|
},
|
|
112
119
|
"devDependencies": {
|
|
@@ -116,15 +123,15 @@
|
|
|
116
123
|
"@biomejs/biome": "1.9.4",
|
|
117
124
|
"eslint": "9.28.0",
|
|
118
125
|
"eslint-typegen": "2.2.0",
|
|
119
|
-
"oxlint": "0.
|
|
126
|
+
"oxlint": "0.18.1",
|
|
120
127
|
"husky": "9.1.7",
|
|
121
128
|
"lint-staged": "16.1.0",
|
|
122
129
|
"rimraf": "6.0.1",
|
|
123
130
|
"tsup": "8.5.0",
|
|
124
131
|
"typescript": "5.8.3",
|
|
125
|
-
"vitest": "3.2.
|
|
132
|
+
"vitest": "3.2.3",
|
|
126
133
|
"jsonc-parser": "3.3.1",
|
|
127
|
-
"@types/node": "
|
|
134
|
+
"@types/node": "24.0.0",
|
|
128
135
|
"@types/bun": "1.2.15"
|
|
129
136
|
},
|
|
130
137
|
"publishConfig": {
|