@kitschpatrol/eslint-config 5.8.3 → 5.9.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/bin/cli.js +1 -1
- package/dist/index.d.ts +185 -2
- package/dist/index.js +591 -49
- package/package.json +13 -12
package/bin/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -405,6 +405,16 @@ interface RuleOptions {
|
|
|
405
405
|
* @see https://eslint.org/docs/latest/rules/curly
|
|
406
406
|
*/
|
|
407
407
|
curly?: Linter.RuleEntry<Curly>
|
|
408
|
+
/**
|
|
409
|
+
* Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan’s law
|
|
410
|
+
* @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-conjunction.md
|
|
411
|
+
*/
|
|
412
|
+
'de-morgan/no-negated-conjunction'?: Linter.RuleEntry<[]>
|
|
413
|
+
/**
|
|
414
|
+
* Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan’s law
|
|
415
|
+
* @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-disjunction.md
|
|
416
|
+
*/
|
|
417
|
+
'de-morgan/no-negated-disjunction'?: Linter.RuleEntry<[]>
|
|
408
418
|
/**
|
|
409
419
|
* Require `default` cases in `switch` statements
|
|
410
420
|
* @see https://eslint.org/docs/latest/rules/default-case
|
|
@@ -1371,6 +1381,11 @@ interface RuleOptions {
|
|
|
1371
1381
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
|
|
1372
1382
|
*/
|
|
1373
1383
|
'jsdoc/require-property-type'?: Linter.RuleEntry<[]>
|
|
1384
|
+
/**
|
|
1385
|
+
* Requires that Promise rejections are documented with `@rejects` tags.
|
|
1386
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-rejects.md#repos-sticky-header
|
|
1387
|
+
*/
|
|
1388
|
+
'jsdoc/require-rejects'?: Linter.RuleEntry<JsdocRequireRejects>
|
|
1374
1389
|
/**
|
|
1375
1390
|
* Requires that returns are documented with `@returns`.
|
|
1376
1391
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
|
|
@@ -1506,6 +1521,11 @@ interface RuleOptions {
|
|
|
1506
1521
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/no-redundant-files.md
|
|
1507
1522
|
*/
|
|
1508
1523
|
'json-package/no-redundant-files'?: Linter.RuleEntry<[]>
|
|
1524
|
+
/**
|
|
1525
|
+
* Warns when publishConfig.access is used in unscoped packages.
|
|
1526
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/no-redundant-publishConfig.md
|
|
1527
|
+
*/
|
|
1528
|
+
'json-package/no-redundant-publishConfig'?: Linter.RuleEntry<[]>
|
|
1509
1529
|
/**
|
|
1510
1530
|
* Package properties must be declared in standard order
|
|
1511
1531
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/order-properties.md
|
|
@@ -1516,6 +1536,11 @@ interface RuleOptions {
|
|
|
1516
1536
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/repository-shorthand.md
|
|
1517
1537
|
*/
|
|
1518
1538
|
'json-package/repository-shorthand'?: Linter.RuleEntry<JsonPackageRepositoryShorthand>
|
|
1539
|
+
/**
|
|
1540
|
+
* Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor.
|
|
1541
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-attribution.md
|
|
1542
|
+
*/
|
|
1543
|
+
'json-package/require-attribution'?: Linter.RuleEntry<JsonPackageRequireAttribution>
|
|
1519
1544
|
/**
|
|
1520
1545
|
* Requires the `author` property to be present.
|
|
1521
1546
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-author.md
|
|
@@ -1551,6 +1576,11 @@ interface RuleOptions {
|
|
|
1551
1576
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-engines.md
|
|
1552
1577
|
*/
|
|
1553
1578
|
'json-package/require-engines'?: Linter.RuleEntry<JsonPackageRequireEngines>
|
|
1579
|
+
/**
|
|
1580
|
+
* Requires the `exports` property to be present.
|
|
1581
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-exports.md
|
|
1582
|
+
*/
|
|
1583
|
+
'json-package/require-exports'?: Linter.RuleEntry<JsonPackageRequireExports>
|
|
1554
1584
|
/**
|
|
1555
1585
|
* Requires the `files` property to be present.
|
|
1556
1586
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-files.md
|
|
@@ -1581,6 +1611,11 @@ interface RuleOptions {
|
|
|
1581
1611
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-peerDependencies.md
|
|
1582
1612
|
*/
|
|
1583
1613
|
'json-package/require-peerDependencies'?: Linter.RuleEntry<JsonPackageRequirePeerDependencies>
|
|
1614
|
+
/**
|
|
1615
|
+
* Requires the `sideEffects` property to be present.
|
|
1616
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-sideEffects.md
|
|
1617
|
+
*/
|
|
1618
|
+
'json-package/require-sideEffects'?: Linter.RuleEntry<JsonPackageRequireSideEffects>
|
|
1584
1619
|
/**
|
|
1585
1620
|
* Requires the `type` property to be present.
|
|
1586
1621
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/require-type.md
|
|
@@ -1616,6 +1651,11 @@ interface RuleOptions {
|
|
|
1616
1651
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/sort-collections.md
|
|
1617
1652
|
*/
|
|
1618
1653
|
'json-package/sort-collections'?: Linter.RuleEntry<JsonPackageSortCollections>
|
|
1654
|
+
/**
|
|
1655
|
+
* Requires that all peer dependencies are also declared as dev dependencies
|
|
1656
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/specify-peers-locally.md
|
|
1657
|
+
*/
|
|
1658
|
+
'json-package/specify-peers-locally'?: Linter.RuleEntry<[]>
|
|
1619
1659
|
/**
|
|
1620
1660
|
* Checks a dependency isn't specified more than once (i.e. in `dependencies` and `devDependencies`)
|
|
1621
1661
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/unique-dependencies.md
|
|
@@ -1641,6 +1681,11 @@ interface RuleOptions {
|
|
|
1641
1681
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-config.md
|
|
1642
1682
|
*/
|
|
1643
1683
|
'json-package/valid-config'?: Linter.RuleEntry<[]>
|
|
1684
|
+
/**
|
|
1685
|
+
* Enforce that the `contributors` property is valid.
|
|
1686
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-contributors.md
|
|
1687
|
+
*/
|
|
1688
|
+
'json-package/valid-contributors'?: Linter.RuleEntry<[]>
|
|
1644
1689
|
/**
|
|
1645
1690
|
* Enforce that the `cpu` property is valid.
|
|
1646
1691
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-cpu.md
|
|
@@ -1666,11 +1711,31 @@ interface RuleOptions {
|
|
|
1666
1711
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-directories.md
|
|
1667
1712
|
*/
|
|
1668
1713
|
'json-package/valid-directories'?: Linter.RuleEntry<[]>
|
|
1714
|
+
/**
|
|
1715
|
+
* Enforce that the `engines` property is valid.
|
|
1716
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-engines.md
|
|
1717
|
+
*/
|
|
1718
|
+
'json-package/valid-engines'?: Linter.RuleEntry<[]>
|
|
1669
1719
|
/**
|
|
1670
1720
|
* Enforce that the `exports` property is valid.
|
|
1671
1721
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-exports.md
|
|
1672
1722
|
*/
|
|
1673
1723
|
'json-package/valid-exports'?: Linter.RuleEntry<[]>
|
|
1724
|
+
/**
|
|
1725
|
+
* Enforce that the `files` property is valid.
|
|
1726
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-files.md
|
|
1727
|
+
*/
|
|
1728
|
+
'json-package/valid-files'?: Linter.RuleEntry<[]>
|
|
1729
|
+
/**
|
|
1730
|
+
* Enforce that the `homepage` property is valid.
|
|
1731
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-homepage.md
|
|
1732
|
+
*/
|
|
1733
|
+
'json-package/valid-homepage'?: Linter.RuleEntry<[]>
|
|
1734
|
+
/**
|
|
1735
|
+
* Enforce that the `keywords` property is valid.
|
|
1736
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-keywords.md
|
|
1737
|
+
*/
|
|
1738
|
+
'json-package/valid-keywords'?: Linter.RuleEntry<[]>
|
|
1674
1739
|
/**
|
|
1675
1740
|
* Enforce that the `license` property is valid.
|
|
1676
1741
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-license.md
|
|
@@ -1682,6 +1747,16 @@ interface RuleOptions {
|
|
|
1682
1747
|
* @deprecated
|
|
1683
1748
|
*/
|
|
1684
1749
|
'json-package/valid-local-dependency'?: Linter.RuleEntry<[]>
|
|
1750
|
+
/**
|
|
1751
|
+
* Enforce that the `main` property is valid.
|
|
1752
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-main.md
|
|
1753
|
+
*/
|
|
1754
|
+
'json-package/valid-main'?: Linter.RuleEntry<[]>
|
|
1755
|
+
/**
|
|
1756
|
+
* Enforce that the `man` property is valid.
|
|
1757
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-man.md
|
|
1758
|
+
*/
|
|
1759
|
+
'json-package/valid-man'?: Linter.RuleEntry<[]>
|
|
1685
1760
|
/**
|
|
1686
1761
|
* Enforce that package names are valid npm package names
|
|
1687
1762
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-name.md
|
|
@@ -1692,9 +1767,15 @@ interface RuleOptions {
|
|
|
1692
1767
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-optionalDependencies.md
|
|
1693
1768
|
*/
|
|
1694
1769
|
'json-package/valid-optionalDependencies'?: Linter.RuleEntry<[]>
|
|
1770
|
+
/**
|
|
1771
|
+
* Enforce that the `os` property is valid.
|
|
1772
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-os.md
|
|
1773
|
+
*/
|
|
1774
|
+
'json-package/valid-os'?: Linter.RuleEntry<[]>
|
|
1695
1775
|
/**
|
|
1696
1776
|
* Enforce that package.json has all properties required by the npm spec
|
|
1697
1777
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-package-definition.md
|
|
1778
|
+
* @deprecated
|
|
1698
1779
|
*/
|
|
1699
1780
|
'json-package/valid-package-definition'?: Linter.RuleEntry<JsonPackageValidPackageDefinition>
|
|
1700
1781
|
/**
|
|
@@ -1702,6 +1783,21 @@ interface RuleOptions {
|
|
|
1702
1783
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-peerDependencies.md
|
|
1703
1784
|
*/
|
|
1704
1785
|
'json-package/valid-peerDependencies'?: Linter.RuleEntry<[]>
|
|
1786
|
+
/**
|
|
1787
|
+
* Enforce that the `private` property is valid.
|
|
1788
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-private.md
|
|
1789
|
+
*/
|
|
1790
|
+
'json-package/valid-private'?: Linter.RuleEntry<[]>
|
|
1791
|
+
/**
|
|
1792
|
+
* Enforce that the `publishConfig` property is valid.
|
|
1793
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-publishConfig.md
|
|
1794
|
+
*/
|
|
1795
|
+
'json-package/valid-publishConfig'?: Linter.RuleEntry<[]>
|
|
1796
|
+
/**
|
|
1797
|
+
* Enforce that the `repository` property is valid.
|
|
1798
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-repository.md
|
|
1799
|
+
*/
|
|
1800
|
+
'json-package/valid-repository'?: Linter.RuleEntry<[]>
|
|
1705
1801
|
/**
|
|
1706
1802
|
* Enforce that if repository directory is specified, it matches the path to the package.json file
|
|
1707
1803
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-repository-directory.md
|
|
@@ -1712,6 +1808,11 @@ interface RuleOptions {
|
|
|
1712
1808
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-scripts.md
|
|
1713
1809
|
*/
|
|
1714
1810
|
'json-package/valid-scripts'?: Linter.RuleEntry<[]>
|
|
1811
|
+
/**
|
|
1812
|
+
* Enforce that the `sideEffects` property is valid.
|
|
1813
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-sideEffects.md
|
|
1814
|
+
*/
|
|
1815
|
+
'json-package/valid-sideEffects'?: Linter.RuleEntry<[]>
|
|
1715
1816
|
/**
|
|
1716
1817
|
* Enforce that the `type` property is valid.
|
|
1717
1818
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-type.md
|
|
@@ -1722,6 +1823,11 @@ interface RuleOptions {
|
|
|
1722
1823
|
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-version.md
|
|
1723
1824
|
*/
|
|
1724
1825
|
'json-package/valid-version'?: Linter.RuleEntry<[]>
|
|
1826
|
+
/**
|
|
1827
|
+
* Enforce that the `workspaces` property is valid.
|
|
1828
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/blob/HEAD/docs/rules/valid-workspaces.md
|
|
1829
|
+
*/
|
|
1830
|
+
'json-package/valid-workspaces'?: Linter.RuleEntry<[]>
|
|
1725
1831
|
/**
|
|
1726
1832
|
* enforce line breaks after opening and before closing array brackets
|
|
1727
1833
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-newline.html
|
|
@@ -4961,6 +5067,11 @@ interface RuleOptions {
|
|
|
4961
5067
|
* @deprecated
|
|
4962
5068
|
*/
|
|
4963
5069
|
'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>
|
|
5070
|
+
/**
|
|
5071
|
+
* enforce using `.each` or `.for` consistently
|
|
5072
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
|
|
5073
|
+
*/
|
|
5074
|
+
'test/consistent-each-for'?: Linter.RuleEntry<TestConsistentEachFor>
|
|
4964
5075
|
/**
|
|
4965
5076
|
* require test file pattern
|
|
4966
5077
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
@@ -5183,7 +5294,7 @@ interface RuleOptions {
|
|
|
5183
5294
|
*/
|
|
5184
5295
|
'test/prefer-each'?: Linter.RuleEntry<[]>
|
|
5185
5296
|
/**
|
|
5186
|
-
* enforce using the built-in
|
|
5297
|
+
* enforce using the built-in equality matchers
|
|
5187
5298
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
5188
5299
|
*/
|
|
5189
5300
|
'test/prefer-equality-matcher'?: Linter.RuleEntry<[]>
|
|
@@ -5292,11 +5403,21 @@ interface RuleOptions {
|
|
|
5292
5403
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
5293
5404
|
*/
|
|
5294
5405
|
'test/prefer-vi-mocked'?: Linter.RuleEntry<[]>
|
|
5406
|
+
/**
|
|
5407
|
+
* ensure that every `expect.poll` call is awaited
|
|
5408
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
|
|
5409
|
+
*/
|
|
5410
|
+
'test/require-awaited-expect-poll'?: Linter.RuleEntry<[]>
|
|
5295
5411
|
/**
|
|
5296
5412
|
* require setup and teardown to be within a hook
|
|
5297
5413
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
5298
5414
|
*/
|
|
5299
5415
|
'test/require-hook'?: Linter.RuleEntry<TestRequireHook>
|
|
5416
|
+
/**
|
|
5417
|
+
* require usage of import in vi.mock()
|
|
5418
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
|
|
5419
|
+
*/
|
|
5420
|
+
'test/require-import-vi-mock'?: Linter.RuleEntry<[]>
|
|
5300
5421
|
/**
|
|
5301
5422
|
* require local Test Context for concurrent snapshot tests
|
|
5302
5423
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
@@ -5896,6 +6017,11 @@ interface RuleOptions {
|
|
|
5896
6017
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
5897
6018
|
*/
|
|
5898
6019
|
'ts/no-unused-expressions'?: Linter.RuleEntry<TsNoUnusedExpressions>
|
|
6020
|
+
/**
|
|
6021
|
+
* Disallow unused private class members
|
|
6022
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
6023
|
+
*/
|
|
6024
|
+
'ts/no-unused-private-class-members'?: Linter.RuleEntry<[]>
|
|
5899
6025
|
/**
|
|
5900
6026
|
* Disallow unused variables
|
|
5901
6027
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -8605,6 +8731,8 @@ type JsdocCheckIndentation =
|
|
|
8605
8731
|
| []
|
|
8606
8732
|
| [
|
|
8607
8733
|
{
|
|
8734
|
+
allowIndentedSections?: boolean
|
|
8735
|
+
|
|
8608
8736
|
excludeTags?: string[]
|
|
8609
8737
|
},
|
|
8610
8738
|
]
|
|
@@ -9275,6 +9403,22 @@ type JsdocRequireParamType =
|
|
|
9275
9403
|
setDefaultDestructuredRootType?: boolean
|
|
9276
9404
|
},
|
|
9277
9405
|
]
|
|
9406
|
+
// ----- jsdoc/require-rejects -----
|
|
9407
|
+
type JsdocRequireRejects =
|
|
9408
|
+
| []
|
|
9409
|
+
| [
|
|
9410
|
+
{
|
|
9411
|
+
contexts?: (
|
|
9412
|
+
| string
|
|
9413
|
+
| {
|
|
9414
|
+
comment?: string
|
|
9415
|
+
context?: string
|
|
9416
|
+
}
|
|
9417
|
+
)[]
|
|
9418
|
+
|
|
9419
|
+
exemptedBy?: string[]
|
|
9420
|
+
},
|
|
9421
|
+
]
|
|
9278
9422
|
// ----- jsdoc/require-returns -----
|
|
9279
9423
|
type JsdocRequireReturns =
|
|
9280
9424
|
| []
|
|
@@ -9451,6 +9595,10 @@ type JsdocSortTags =
|
|
|
9451
9595
|
|
|
9452
9596
|
reportTagGroupSpacing?: boolean
|
|
9453
9597
|
|
|
9598
|
+
tagExceptions?: {
|
|
9599
|
+
[k: string]: number
|
|
9600
|
+
}
|
|
9601
|
+
|
|
9454
9602
|
tagSequence?: {
|
|
9455
9603
|
tags?: string[]
|
|
9456
9604
|
}[]
|
|
@@ -9624,6 +9772,14 @@ type JsonPackageRepositoryShorthand =
|
|
|
9624
9772
|
form?: 'object' | 'shorthand'
|
|
9625
9773
|
},
|
|
9626
9774
|
]
|
|
9775
|
+
// ----- json-package/require-attribution -----
|
|
9776
|
+
type JsonPackageRequireAttribution =
|
|
9777
|
+
| []
|
|
9778
|
+
| [
|
|
9779
|
+
{
|
|
9780
|
+
preferContributorsOnly?: boolean
|
|
9781
|
+
},
|
|
9782
|
+
]
|
|
9627
9783
|
// ----- json-package/require-author -----
|
|
9628
9784
|
type JsonPackageRequireAuthor =
|
|
9629
9785
|
| []
|
|
@@ -9680,6 +9836,14 @@ type JsonPackageRequireEngines =
|
|
|
9680
9836
|
ignorePrivate?: boolean
|
|
9681
9837
|
},
|
|
9682
9838
|
]
|
|
9839
|
+
// ----- json-package/require-exports -----
|
|
9840
|
+
type JsonPackageRequireExports =
|
|
9841
|
+
| []
|
|
9842
|
+
| [
|
|
9843
|
+
{
|
|
9844
|
+
ignorePrivate?: boolean
|
|
9845
|
+
},
|
|
9846
|
+
]
|
|
9683
9847
|
// ----- json-package/require-files -----
|
|
9684
9848
|
type JsonPackageRequireFiles =
|
|
9685
9849
|
| []
|
|
@@ -9728,6 +9892,14 @@ type JsonPackageRequirePeerDependencies =
|
|
|
9728
9892
|
ignorePrivate?: boolean
|
|
9729
9893
|
},
|
|
9730
9894
|
]
|
|
9895
|
+
// ----- json-package/require-sideEffects -----
|
|
9896
|
+
type JsonPackageRequireSideEffects =
|
|
9897
|
+
| []
|
|
9898
|
+
| [
|
|
9899
|
+
{
|
|
9900
|
+
ignorePrivate?: boolean
|
|
9901
|
+
},
|
|
9902
|
+
]
|
|
9731
9903
|
// ----- json-package/require-type -----
|
|
9732
9904
|
type JsonPackageRequireType =
|
|
9733
9905
|
| []
|
|
@@ -20347,6 +20519,17 @@ type SwitchColonSpacing =
|
|
|
20347
20519
|
type TemplateCurlySpacing = [] | ['always' | 'never']
|
|
20348
20520
|
// ----- template-tag-spacing -----
|
|
20349
20521
|
type TemplateTagSpacing = [] | ['always' | 'never']
|
|
20522
|
+
// ----- test/consistent-each-for -----
|
|
20523
|
+
type TestConsistentEachFor =
|
|
20524
|
+
| []
|
|
20525
|
+
| [
|
|
20526
|
+
{
|
|
20527
|
+
test?: 'each' | 'for'
|
|
20528
|
+
it?: 'each' | 'for'
|
|
20529
|
+
describe?: 'each' | 'for'
|
|
20530
|
+
suite?: 'each' | 'for'
|
|
20531
|
+
},
|
|
20532
|
+
]
|
|
20350
20533
|
// ----- test/consistent-test-filename -----
|
|
20351
20534
|
type TestConsistentTestFilename =
|
|
20352
20535
|
| []
|
|
@@ -20411,7 +20594,7 @@ type TestNoHooks =
|
|
|
20411
20594
|
| []
|
|
20412
20595
|
| [
|
|
20413
20596
|
{
|
|
20414
|
-
allow?:
|
|
20597
|
+
allow?: ('beforeAll' | 'beforeEach' | 'afterAll' | 'afterEach')[]
|
|
20415
20598
|
},
|
|
20416
20599
|
]
|
|
20417
20600
|
// ----- test/no-large-snapshots -----
|
package/dist/index.js
CHANGED
|
@@ -209,6 +209,14 @@ var astroJsxA11yRecommendedRules = {
|
|
|
209
209
|
// End expansion
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
+
// src/presets/de-morgan.ts
|
|
213
|
+
var deMorganRecommendedRules = {
|
|
214
|
+
// Begin expansion 'eslint-plugin-de-morgan' 'recommended'
|
|
215
|
+
"de-morgan/no-negated-conjunction": "error",
|
|
216
|
+
"de-morgan/no-negated-disjunction": "error"
|
|
217
|
+
// End expansion
|
|
218
|
+
};
|
|
219
|
+
|
|
212
220
|
// src/presets/depend.ts
|
|
213
221
|
var dependRecommendedRules = {
|
|
214
222
|
// Begin expansion 'eslint-plugin-depend' 'recommended'
|
|
@@ -585,6 +593,7 @@ var jsdocCommentsRecommendedTypescriptFlavorRules = {
|
|
|
585
593
|
"jsdoc/require-property-description": "warn",
|
|
586
594
|
"jsdoc/require-property-name": "warn",
|
|
587
595
|
"jsdoc/require-property-type": "warn",
|
|
596
|
+
"jsdoc/require-rejects": "off",
|
|
588
597
|
"jsdoc/require-returns": "warn",
|
|
589
598
|
"jsdoc/require-returns-check": "warn",
|
|
590
599
|
"jsdoc/require-returns-description": "warn",
|
|
@@ -663,6 +672,7 @@ var jsdocCommentsRecommendedTypescriptRules = {
|
|
|
663
672
|
"jsdoc/require-property-description": "warn",
|
|
664
673
|
"jsdoc/require-property-name": "warn",
|
|
665
674
|
"jsdoc/require-property-type": "off",
|
|
675
|
+
"jsdoc/require-rejects": "off",
|
|
666
676
|
"jsdoc/require-returns": "warn",
|
|
667
677
|
"jsdoc/require-returns-check": "warn",
|
|
668
678
|
"jsdoc/require-returns-description": "warn",
|
|
@@ -807,6 +817,7 @@ var jsonPackageRecommendedRules = {
|
|
|
807
817
|
// Begin expansion 'eslint-plugin-package-json' 'configs.recommended.rules'
|
|
808
818
|
"json-package/no-empty-fields": "error",
|
|
809
819
|
"json-package/no-redundant-files": "error",
|
|
820
|
+
"json-package/no-redundant-publishConfig": "error",
|
|
810
821
|
"json-package/order-properties": "error",
|
|
811
822
|
"json-package/require-description": "error",
|
|
812
823
|
"json-package/require-license": "error",
|
|
@@ -815,48 +826,37 @@ var jsonPackageRecommendedRules = {
|
|
|
815
826
|
"json-package/require-version": "error",
|
|
816
827
|
"json-package/repository-shorthand": "error",
|
|
817
828
|
"json-package/sort-collections": "error",
|
|
829
|
+
"json-package/specify-peers-locally": "error",
|
|
818
830
|
"json-package/unique-dependencies": "error",
|
|
831
|
+
"json-package/valid-author": "error",
|
|
819
832
|
"json-package/valid-bin": "error",
|
|
820
833
|
"json-package/valid-bundleDependencies": "error",
|
|
821
834
|
"json-package/valid-config": "error",
|
|
835
|
+
"json-package/valid-contributors": "error",
|
|
822
836
|
"json-package/valid-cpu": "error",
|
|
823
|
-
"json-package/valid-dependencies": "error",
|
|
824
837
|
"json-package/valid-description": "error",
|
|
838
|
+
"json-package/valid-dependencies": "error",
|
|
825
839
|
"json-package/valid-devDependencies": "error",
|
|
826
840
|
"json-package/valid-directories": "error",
|
|
841
|
+
"json-package/valid-engines": "error",
|
|
827
842
|
"json-package/valid-exports": "error",
|
|
843
|
+
"json-package/valid-files": "error",
|
|
844
|
+
"json-package/valid-homepage": "error",
|
|
845
|
+
"json-package/valid-keywords": "error",
|
|
828
846
|
"json-package/valid-license": "error",
|
|
847
|
+
"json-package/valid-main": "error",
|
|
848
|
+
"json-package/valid-man": "error",
|
|
829
849
|
"json-package/valid-optionalDependencies": "error",
|
|
850
|
+
"json-package/valid-os": "error",
|
|
830
851
|
"json-package/valid-peerDependencies": "error",
|
|
852
|
+
"json-package/valid-private": "error",
|
|
853
|
+
"json-package/valid-publishConfig": "error",
|
|
854
|
+
"json-package/valid-repository": "error",
|
|
831
855
|
"json-package/valid-scripts": "error",
|
|
856
|
+
"json-package/valid-sideEffects": "error",
|
|
832
857
|
"json-package/valid-type": "error",
|
|
833
|
-
"json-package/valid-
|
|
858
|
+
"json-package/valid-workspaces": "error",
|
|
834
859
|
"json-package/valid-name": "error",
|
|
835
|
-
"json-package/valid-package-definition": [
|
|
836
|
-
"error",
|
|
837
|
-
{
|
|
838
|
-
ignoreProperties: [
|
|
839
|
-
"bin",
|
|
840
|
-
"bundleDependencies",
|
|
841
|
-
"config",
|
|
842
|
-
"cpu",
|
|
843
|
-
"dependencies",
|
|
844
|
-
"description",
|
|
845
|
-
"devDependencies",
|
|
846
|
-
"directories",
|
|
847
|
-
"exports",
|
|
848
|
-
"license",
|
|
849
|
-
"optionalDependencies",
|
|
850
|
-
"peerDependencies",
|
|
851
|
-
"scripts",
|
|
852
|
-
"type",
|
|
853
|
-
"author",
|
|
854
|
-
"name",
|
|
855
|
-
"repository-directory",
|
|
856
|
-
"version"
|
|
857
|
-
]
|
|
858
|
-
}
|
|
859
|
-
],
|
|
860
860
|
"json-package/valid-repository-directory": "error",
|
|
861
861
|
"json-package/valid-version": "error"
|
|
862
862
|
// End expansion
|
|
@@ -1571,13 +1571,20 @@ var svelteRecommendedRules = {
|
|
|
1571
1571
|
var testRecommendedRules = {
|
|
1572
1572
|
// Begin expansion '@vitest/eslint-plugin' 'recommended'
|
|
1573
1573
|
"test/expect-expect": "error",
|
|
1574
|
+
"test/no-conditional-expect": "error",
|
|
1575
|
+
"test/no-disabled-tests": "warn",
|
|
1576
|
+
"test/no-focused-tests": "error",
|
|
1574
1577
|
"test/no-commented-out-tests": "error",
|
|
1575
1578
|
"test/no-identical-title": "error",
|
|
1576
1579
|
"test/no-import-node-test": "error",
|
|
1580
|
+
"test/no-interpolation-in-snapshots": "error",
|
|
1581
|
+
"test/no-mocks-import": "error",
|
|
1582
|
+
"test/no-standalone-expect": "error",
|
|
1577
1583
|
"test/prefer-called-exactly-once-with": "error",
|
|
1578
1584
|
"test/require-local-test-context-for-concurrent-snapshots": "error",
|
|
1579
1585
|
"test/valid-describe-callback": "error",
|
|
1580
1586
|
"test/valid-expect": "error",
|
|
1587
|
+
"test/valid-expect-in-promise": "error",
|
|
1581
1588
|
"test/valid-title": "error"
|
|
1582
1589
|
// End expansion
|
|
1583
1590
|
};
|
|
@@ -2368,8 +2375,8 @@ var yamlRecommendedRules = {
|
|
|
2368
2375
|
|
|
2369
2376
|
// src/utilities.ts
|
|
2370
2377
|
import process2 from "process";
|
|
2371
|
-
async function combine(...
|
|
2372
|
-
const resolved = await Promise.all(
|
|
2378
|
+
async function combine(...configs2) {
|
|
2379
|
+
const resolved = await Promise.all(configs2);
|
|
2373
2380
|
return resolved.flat();
|
|
2374
2381
|
}
|
|
2375
2382
|
async function interopDefault(m) {
|
|
@@ -2393,8 +2400,8 @@ function isInGitHooksOrLintStaged() {
|
|
|
2393
2400
|
const gitEnvVariables = [process2.env.GIT_PARAMS, process2.env.VSCODE_GIT_COMMAND, isLintStaged];
|
|
2394
2401
|
return gitEnvVariables.some(Boolean);
|
|
2395
2402
|
}
|
|
2396
|
-
function renamePluginInConfigs(
|
|
2397
|
-
return
|
|
2403
|
+
function renamePluginInConfigs(configs2, map) {
|
|
2404
|
+
return configs2.map((i) => {
|
|
2398
2405
|
const clone = { ...i };
|
|
2399
2406
|
clone.rules &&= renameRules(clone.rules, map);
|
|
2400
2407
|
clone.plugins &&= Object.fromEntries(
|
|
@@ -2406,9 +2413,9 @@ function renamePluginInConfigs(configs, map) {
|
|
|
2406
2413
|
return clone;
|
|
2407
2414
|
});
|
|
2408
2415
|
}
|
|
2409
|
-
function renameRules(
|
|
2416
|
+
function renameRules(rules2, map) {
|
|
2410
2417
|
return Object.fromEntries(
|
|
2411
|
-
Object.entries(
|
|
2418
|
+
Object.entries(rules2).map(([key, value]) => {
|
|
2412
2419
|
for (const [from, to] of Object.entries(map)) {
|
|
2413
2420
|
if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
|
|
2414
2421
|
}
|
|
@@ -2466,6 +2473,532 @@ function generatePerfectionistSortConfig(strings, matchType = "exact") {
|
|
|
2466
2473
|
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
2467
2474
|
import pluginTs from "@typescript-eslint/eslint-plugin";
|
|
2468
2475
|
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
2476
|
+
|
|
2477
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/package.json.js
|
|
2478
|
+
var name = "eslint-plugin-de-morgan";
|
|
2479
|
+
var version = "2.0.0";
|
|
2480
|
+
var repository = "azat-io/eslint-plugin-de-morgan";
|
|
2481
|
+
|
|
2482
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/create-test-with-parameters.js
|
|
2483
|
+
function createTestWithParameters(...parameters) {
|
|
2484
|
+
return (...predicates) => predicates.every((predicate) => predicate(...parameters));
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-logical-expression.js
|
|
2488
|
+
function isLogicalExpression(node) {
|
|
2489
|
+
return node.type === "LogicalExpression";
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/find-outermost-parenthesized-node.js
|
|
2493
|
+
function findOutermostParenthesizedNode(node, sourceCode) {
|
|
2494
|
+
let current = node;
|
|
2495
|
+
let [start, end] = current.range;
|
|
2496
|
+
if (isInParentheses(start, end, sourceCode)) {
|
|
2497
|
+
return current;
|
|
2498
|
+
}
|
|
2499
|
+
while (current.parent && isLogicalExpression(current)) {
|
|
2500
|
+
current = current.parent;
|
|
2501
|
+
[start, end] = current.range;
|
|
2502
|
+
if (isInParentheses(start, end, sourceCode)) {
|
|
2503
|
+
return current;
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
return current;
|
|
2507
|
+
}
|
|
2508
|
+
function isInParentheses(start, end, sourceCode) {
|
|
2509
|
+
return sourceCode[start - 1] === "(" && sourceCode[end] === ")";
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-unary-expression.js
|
|
2513
|
+
function isUnaryExpression(node) {
|
|
2514
|
+
return node.type === "UnaryExpression";
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/has-operator.js
|
|
2518
|
+
function hasOperator(operator) {
|
|
2519
|
+
return (node) => node.operator === operator;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/has-negation-operator.js
|
|
2523
|
+
function hasNegationOperator(node) {
|
|
2524
|
+
let test2 = createTestWithParameters(node);
|
|
2525
|
+
return test2(isUnaryExpression, hasOperator("!"));
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/has-negation-inside-parens.js
|
|
2529
|
+
function hasNegationInsideParens(node, context) {
|
|
2530
|
+
let sourceCode = context.sourceCode.getText(node);
|
|
2531
|
+
let outermostNode = findOutermostParenthesizedNode(node, sourceCode);
|
|
2532
|
+
if (!isUnaryExpression(outermostNode)) {
|
|
2533
|
+
return false;
|
|
2534
|
+
}
|
|
2535
|
+
return hasNegationInside(outermostNode.argument);
|
|
2536
|
+
}
|
|
2537
|
+
function hasNegationInside(node) {
|
|
2538
|
+
if (isUnaryExpression(node) && node.operator === "!" && isUnaryExpression(node.argument) && node.argument.operator === "!") {
|
|
2539
|
+
return hasNegationInside(node.argument.argument);
|
|
2540
|
+
}
|
|
2541
|
+
if (hasNegationOperator(node)) {
|
|
2542
|
+
return true;
|
|
2543
|
+
}
|
|
2544
|
+
if (isLogicalExpression(node)) {
|
|
2545
|
+
return hasNegationInside(node.left) || hasNegationInside(node.right);
|
|
2546
|
+
}
|
|
2547
|
+
return false;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-binary-expression.js
|
|
2551
|
+
function isBinaryExpression(node) {
|
|
2552
|
+
return node.type === "BinaryExpression";
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/has-boolean-context.js
|
|
2556
|
+
function hasBooleanContext(node, _context) {
|
|
2557
|
+
return node.parent ? isControlFlowBooleanContext(node.parent) || isBooleanOperation(node.parent) || isBooleanFunction(node.parent) : false;
|
|
2558
|
+
}
|
|
2559
|
+
function isControlFlowBooleanContext(parent) {
|
|
2560
|
+
return booleanControlFlowNodes.has(parent.type);
|
|
2561
|
+
}
|
|
2562
|
+
var booleanControlFlowNodes = /* @__PURE__ */ new Set([
|
|
2563
|
+
"ConditionalExpression",
|
|
2564
|
+
"LogicalExpression",
|
|
2565
|
+
"DoWhileStatement",
|
|
2566
|
+
"UnaryExpression",
|
|
2567
|
+
"WhileStatement",
|
|
2568
|
+
"ForStatement",
|
|
2569
|
+
"IfStatement"
|
|
2570
|
+
]);
|
|
2571
|
+
function isBooleanOperation(parent) {
|
|
2572
|
+
return isBinaryExpression(parent) && booleanOperators.has(parent.operator);
|
|
2573
|
+
}
|
|
2574
|
+
var booleanOperators = /* @__PURE__ */ new Set([
|
|
2575
|
+
"instanceof",
|
|
2576
|
+
"===",
|
|
2577
|
+
"!==",
|
|
2578
|
+
"==",
|
|
2579
|
+
"!=",
|
|
2580
|
+
"<=",
|
|
2581
|
+
">=",
|
|
2582
|
+
"in",
|
|
2583
|
+
"<",
|
|
2584
|
+
">"
|
|
2585
|
+
]);
|
|
2586
|
+
function isBooleanFunction(parent) {
|
|
2587
|
+
return parent.type === "CallExpression" && parent.callee.type === "Identifier" && parent.callee.name === "Boolean";
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/apply-to-property.js
|
|
2591
|
+
function applyToProperty(property, predicate) {
|
|
2592
|
+
return (object) => predicate(object[property]);
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-conjunction.js
|
|
2596
|
+
function isConjunction(node) {
|
|
2597
|
+
let test2 = createTestWithParameters(node);
|
|
2598
|
+
return test2(isLogicalExpression, hasOperator("&&"));
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/sanitize-code.js
|
|
2602
|
+
function sanitizeCode(code) {
|
|
2603
|
+
let stringLiterals = [];
|
|
2604
|
+
let withoutStrings = code.replaceAll(
|
|
2605
|
+
/(?<quote>["'`])(?:\\.|(?!\k<quote>)[^\\])*\k<quote>/gu,
|
|
2606
|
+
(match) => {
|
|
2607
|
+
let placeholder = `__STRING_LITERAL_${stringLiterals.length}__`;
|
|
2608
|
+
stringLiterals.push(match);
|
|
2609
|
+
return placeholder;
|
|
2610
|
+
}
|
|
2611
|
+
);
|
|
2612
|
+
let withoutSingleLineComments = withoutStrings.replaceAll(/\/\/.*$/gmu, "");
|
|
2613
|
+
let withoutComments = withoutSingleLineComments.replaceAll(
|
|
2614
|
+
/\/\*[\s\S]*?\*\//gu,
|
|
2615
|
+
""
|
|
2616
|
+
);
|
|
2617
|
+
let normalized = withoutComments.replaceAll(/\s+/gu, " ").replaceAll(/\(\s+/gu, "(").replaceAll(/\s+\)/gu, ")").trim();
|
|
2618
|
+
for (let [index2, string_] of stringLiterals.entries()) {
|
|
2619
|
+
normalized = normalized.replace(`__STRING_LITERAL_${index2}__`, string_);
|
|
2620
|
+
}
|
|
2621
|
+
return normalized;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-pure-group.js
|
|
2625
|
+
function isPureGroup(node, context) {
|
|
2626
|
+
let sourceCode = context.sourceCode.getText();
|
|
2627
|
+
let outermostNode = findOutermostParenthesizedNode(node, sourceCode);
|
|
2628
|
+
let fullCode = context.sourceCode.getText(outermostNode);
|
|
2629
|
+
let innerCode = getCodeInsideParentheses(fullCode);
|
|
2630
|
+
return !hasMixedOperators(innerCode);
|
|
2631
|
+
}
|
|
2632
|
+
function hasMixedOperators(code) {
|
|
2633
|
+
let depth = 0;
|
|
2634
|
+
let operatorFound = null;
|
|
2635
|
+
for (let i = 0; i < code.length; i++) {
|
|
2636
|
+
let char = code[i];
|
|
2637
|
+
if (char === "(") {
|
|
2638
|
+
depth++;
|
|
2639
|
+
continue;
|
|
2640
|
+
}
|
|
2641
|
+
if (char === ")") {
|
|
2642
|
+
depth--;
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
if (depth !== 0) {
|
|
2646
|
+
continue;
|
|
2647
|
+
}
|
|
2648
|
+
let twoChars = code.slice(i, i + 2);
|
|
2649
|
+
if (twoChars === "&&" || twoChars === "||") {
|
|
2650
|
+
if (operatorFound === null) {
|
|
2651
|
+
operatorFound = twoChars;
|
|
2652
|
+
} else if (operatorFound !== twoChars) {
|
|
2653
|
+
return true;
|
|
2654
|
+
}
|
|
2655
|
+
i++;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
return false;
|
|
2659
|
+
}
|
|
2660
|
+
function getCodeInsideParentheses(code) {
|
|
2661
|
+
if (code.startsWith("!(")) {
|
|
2662
|
+
return code.slice(2, -1);
|
|
2663
|
+
}
|
|
2664
|
+
if (code.startsWith("(")) {
|
|
2665
|
+
return code.slice(1, -1);
|
|
2666
|
+
}
|
|
2667
|
+
return code;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-negated.js
|
|
2671
|
+
function isNegated(node) {
|
|
2672
|
+
return hasNegationOperator(node) && !hasNegationOperator(node.argument) && (!node.parent || !hasNegationOperator(node.parent));
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/parenthesize.js
|
|
2676
|
+
function parenthesize(text, condition = true) {
|
|
2677
|
+
return condition ? `(${text})` : text;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-boolean.js
|
|
2681
|
+
function isBoolean(node) {
|
|
2682
|
+
return node.type === "Literal" && typeof node.value === "boolean";
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/toggle-negation.js
|
|
2686
|
+
function toggleNegation(node, context) {
|
|
2687
|
+
let toggleStrategies = [
|
|
2688
|
+
{
|
|
2689
|
+
transformer: toggleBinaryExpression,
|
|
2690
|
+
predicate: isBinaryExpression
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
transformer: toggleBooleanLiteral,
|
|
2694
|
+
predicate: isBoolean
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
transformer: toggleLogicalExpression,
|
|
2698
|
+
predicate: isLogicalExpression
|
|
2699
|
+
}
|
|
2700
|
+
];
|
|
2701
|
+
for (let { transformer, predicate } of toggleStrategies) {
|
|
2702
|
+
if (predicate(node)) {
|
|
2703
|
+
return transformer(node, context);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
return toggleUnaryExpression(node, context);
|
|
2707
|
+
}
|
|
2708
|
+
function toggleBinaryExpression(node, context) {
|
|
2709
|
+
let left = context.sourceCode.getText(node.left).trim();
|
|
2710
|
+
let right = context.sourceCode.getText(node.right).trim();
|
|
2711
|
+
let notTransformableOperators = [
|
|
2712
|
+
"<<",
|
|
2713
|
+
">>",
|
|
2714
|
+
">>>",
|
|
2715
|
+
"+",
|
|
2716
|
+
"-",
|
|
2717
|
+
"*",
|
|
2718
|
+
"/",
|
|
2719
|
+
"%",
|
|
2720
|
+
"**",
|
|
2721
|
+
"|",
|
|
2722
|
+
"^",
|
|
2723
|
+
"&",
|
|
2724
|
+
"in",
|
|
2725
|
+
"instanceof"
|
|
2726
|
+
];
|
|
2727
|
+
if (notTransformableOperators.includes(node.operator)) {
|
|
2728
|
+
return `!(${left} ${node.operator} ${right})`;
|
|
2729
|
+
}
|
|
2730
|
+
let operatorMap = {
|
|
2731
|
+
"===": "!==",
|
|
2732
|
+
"!==": "===",
|
|
2733
|
+
"==": "!=",
|
|
2734
|
+
"!=": "==",
|
|
2735
|
+
"<": ">=",
|
|
2736
|
+
">": "<=",
|
|
2737
|
+
"<=": ">",
|
|
2738
|
+
">=": "<"
|
|
2739
|
+
};
|
|
2740
|
+
let toggledOperator = operatorMap[node.operator];
|
|
2741
|
+
return `${left} ${toggledOperator} ${right}`;
|
|
2742
|
+
}
|
|
2743
|
+
function toggleLogicalExpression(node, context) {
|
|
2744
|
+
let content = context.sourceCode.getText(node).trim();
|
|
2745
|
+
return toggleCode(parenthesize(content));
|
|
2746
|
+
}
|
|
2747
|
+
function toggleUnaryExpression(node, context) {
|
|
2748
|
+
let content = context.sourceCode.getText(node).trim();
|
|
2749
|
+
return toggleCode(content);
|
|
2750
|
+
}
|
|
2751
|
+
function toggleCode(code) {
|
|
2752
|
+
return code.startsWith("!") ? code.replace(/^!/u, "") : `!${code}`;
|
|
2753
|
+
}
|
|
2754
|
+
function toggleBooleanLiteral(node) {
|
|
2755
|
+
return node.value ? "false" : "true";
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/is-disjunction.js
|
|
2759
|
+
function isDisjunction(node) {
|
|
2760
|
+
let test2 = createTestWithParameters(node);
|
|
2761
|
+
return test2(isLogicalExpression, hasOperator("||"));
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/transform.js
|
|
2765
|
+
var MAX_DEPTH = 10;
|
|
2766
|
+
var OPERATOR_MAPPING = {
|
|
2767
|
+
"&&": "||",
|
|
2768
|
+
"||": "&&"
|
|
2769
|
+
};
|
|
2770
|
+
function transform({ shouldWrapInParens, expressionType, context, node }) {
|
|
2771
|
+
let argument = node.argument;
|
|
2772
|
+
let sourceOperator = expressionType === "conjunction" ? "&&" : "||";
|
|
2773
|
+
if (argument.operator !== sourceOperator) {
|
|
2774
|
+
return null;
|
|
2775
|
+
}
|
|
2776
|
+
let originalText = context.sourceCode.getText(argument);
|
|
2777
|
+
let targetOperator = OPERATOR_MAPPING[sourceOperator];
|
|
2778
|
+
let transformUtilityOptions = {
|
|
2779
|
+
expression: argument,
|
|
2780
|
+
expressionType,
|
|
2781
|
+
sourceOperator,
|
|
2782
|
+
targetOperator,
|
|
2783
|
+
context
|
|
2784
|
+
};
|
|
2785
|
+
let result = hasSpecialFormatting(originalText) ? transformWithFormatting(transformUtilityOptions) : transformSimple(transformUtilityOptions);
|
|
2786
|
+
return parenthesize(result, shouldWrapInParens);
|
|
2787
|
+
}
|
|
2788
|
+
function transformWithFormatting({
|
|
2789
|
+
sourceOperator,
|
|
2790
|
+
targetOperator,
|
|
2791
|
+
expression,
|
|
2792
|
+
context
|
|
2793
|
+
}) {
|
|
2794
|
+
let { sourceCode } = context;
|
|
2795
|
+
let leftText = toggleNegation(expression.left, context);
|
|
2796
|
+
let rightText = toggleNegation(expression.right, context);
|
|
2797
|
+
if (!expression.left.range || !expression.right.range) {
|
|
2798
|
+
return `${leftText} ${targetOperator} ${rightText}`;
|
|
2799
|
+
}
|
|
2800
|
+
let [, leftEnd] = expression.left.range;
|
|
2801
|
+
let [rightStart] = expression.right.range;
|
|
2802
|
+
let textBetween = sourceCode.text.slice(leftEnd, rightStart);
|
|
2803
|
+
let endsWithOpeningParen = /\(\s*$/u.test(textBetween);
|
|
2804
|
+
if (endsWithOpeningParen) {
|
|
2805
|
+
textBetween = textBetween.replace(/\(\s*$/u, "");
|
|
2806
|
+
}
|
|
2807
|
+
let formattedOperator = textBetween.replaceAll(
|
|
2808
|
+
new RegExp(
|
|
2809
|
+
sourceOperator.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`),
|
|
2810
|
+
"gu"
|
|
2811
|
+
),
|
|
2812
|
+
targetOperator
|
|
2813
|
+
);
|
|
2814
|
+
return `${leftText}${formattedOperator}${rightText}`;
|
|
2815
|
+
}
|
|
2816
|
+
function flattenOperands({ expressionType, expression, context }) {
|
|
2817
|
+
let result = [];
|
|
2818
|
+
let stack = [{ expr: expression, depth: 0 }];
|
|
2819
|
+
while (stack.length > 0) {
|
|
2820
|
+
let { depth, expr } = stack.pop();
|
|
2821
|
+
if (depth > MAX_DEPTH || !matchesExpressionType(expr, expressionType)) {
|
|
2822
|
+
result.push(toggleNegation(expr, context));
|
|
2823
|
+
continue;
|
|
2824
|
+
}
|
|
2825
|
+
let logicalExpr = expr;
|
|
2826
|
+
stack.push(
|
|
2827
|
+
{ expr: logicalExpr.right, depth: depth + 1 },
|
|
2828
|
+
{ expr: logicalExpr.left, depth: depth + 1 }
|
|
2829
|
+
);
|
|
2830
|
+
}
|
|
2831
|
+
return result;
|
|
2832
|
+
}
|
|
2833
|
+
function transformSimple({
|
|
2834
|
+
expressionType,
|
|
2835
|
+
targetOperator,
|
|
2836
|
+
expression,
|
|
2837
|
+
context
|
|
2838
|
+
}) {
|
|
2839
|
+
let operands = flattenOperands({
|
|
2840
|
+
expressionType,
|
|
2841
|
+
expression,
|
|
2842
|
+
context
|
|
2843
|
+
});
|
|
2844
|
+
return operands.join(` ${targetOperator} `);
|
|
2845
|
+
}
|
|
2846
|
+
function matchesExpressionType(expression, type) {
|
|
2847
|
+
return type === "conjunction" ? isConjunction(expression) : isDisjunction(expression);
|
|
2848
|
+
}
|
|
2849
|
+
function hasSpecialFormatting(text) {
|
|
2850
|
+
return text.includes("//") || text.includes("/*") || text.includes("\n") || /\s{2,}/u.test(text);
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/not.js
|
|
2854
|
+
function not(predicate) {
|
|
2855
|
+
return (...arguments_) => !predicate(...arguments_);
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/utils/or.js
|
|
2859
|
+
function or(...predicates) {
|
|
2860
|
+
return (...arguments_) => predicates.some((predicate) => predicate(...arguments_));
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/rules/no-negated-conjunction.js
|
|
2864
|
+
var noNegatedConjunction = {
|
|
2865
|
+
create: (context) => ({
|
|
2866
|
+
UnaryExpression: (node) => {
|
|
2867
|
+
let test2 = createTestWithParameters(node, context);
|
|
2868
|
+
if (test2(
|
|
2869
|
+
isNegated,
|
|
2870
|
+
applyToProperty("argument", isConjunction),
|
|
2871
|
+
isPureGroup,
|
|
2872
|
+
or(hasBooleanContext, not(hasNegationInsideParens))
|
|
2873
|
+
)) {
|
|
2874
|
+
let shouldWrapInParens = isConjunction(node.parent);
|
|
2875
|
+
let fixedExpression = transform({
|
|
2876
|
+
expressionType: "conjunction",
|
|
2877
|
+
shouldWrapInParens,
|
|
2878
|
+
context,
|
|
2879
|
+
node
|
|
2880
|
+
});
|
|
2881
|
+
if (fixedExpression) {
|
|
2882
|
+
let originalExpression = context.sourceCode.getText(node);
|
|
2883
|
+
context.report({
|
|
2884
|
+
data: {
|
|
2885
|
+
original: sanitizeCode(originalExpression),
|
|
2886
|
+
fixed: sanitizeCode(fixedExpression)
|
|
2887
|
+
},
|
|
2888
|
+
fix: (fixer) => fixer.replaceText(node, fixedExpression),
|
|
2889
|
+
messageId: "convertNegatedConjunction",
|
|
2890
|
+
node
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}),
|
|
2896
|
+
meta: {
|
|
2897
|
+
docs: {
|
|
2898
|
+
description: "Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan\u2019s law",
|
|
2899
|
+
url: `https://github.com/${repository}/blob/main/docs/no-negated-conjunction.md`,
|
|
2900
|
+
category: "Best Practices",
|
|
2901
|
+
recommended: true
|
|
2902
|
+
},
|
|
2903
|
+
messages: {
|
|
2904
|
+
convertNegatedConjunction: "Replace negated conjunction `{{ original }}` with `{{ fixed }}`"
|
|
2905
|
+
},
|
|
2906
|
+
type: "suggestion",
|
|
2907
|
+
fixable: "code",
|
|
2908
|
+
schema: []
|
|
2909
|
+
}
|
|
2910
|
+
};
|
|
2911
|
+
|
|
2912
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/rules/no-negated-disjunction.js
|
|
2913
|
+
var noNegatedDisjunction = {
|
|
2914
|
+
create: (context) => ({
|
|
2915
|
+
UnaryExpression: (node) => {
|
|
2916
|
+
let test2 = createTestWithParameters(node, context);
|
|
2917
|
+
if (test2(
|
|
2918
|
+
isNegated,
|
|
2919
|
+
applyToProperty("argument", isDisjunction),
|
|
2920
|
+
isPureGroup,
|
|
2921
|
+
or(hasBooleanContext, not(hasNegationInsideParens))
|
|
2922
|
+
)) {
|
|
2923
|
+
let shouldWrapInParens = false;
|
|
2924
|
+
let fixedExpression = transform({
|
|
2925
|
+
expressionType: "disjunction",
|
|
2926
|
+
shouldWrapInParens,
|
|
2927
|
+
context,
|
|
2928
|
+
node
|
|
2929
|
+
});
|
|
2930
|
+
if (fixedExpression) {
|
|
2931
|
+
let originalExpression = context.sourceCode.getText(node);
|
|
2932
|
+
context.report({
|
|
2933
|
+
data: {
|
|
2934
|
+
original: sanitizeCode(originalExpression),
|
|
2935
|
+
fixed: sanitizeCode(fixedExpression)
|
|
2936
|
+
},
|
|
2937
|
+
fix: (fixer) => fixer.replaceText(node, fixedExpression),
|
|
2938
|
+
messageId: "convertNegatedDisjunction",
|
|
2939
|
+
node
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
}),
|
|
2945
|
+
meta: {
|
|
2946
|
+
docs: {
|
|
2947
|
+
description: "Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan\u2019s law",
|
|
2948
|
+
url: `https://github.com/${repository}/blob/main/docs/no-negated-disjunction.md`,
|
|
2949
|
+
category: "Best Practices",
|
|
2950
|
+
recommended: true
|
|
2951
|
+
},
|
|
2952
|
+
messages: {
|
|
2953
|
+
convertNegatedDisjunction: "Replace negated disjunction `{{ original }}` with `{{ fixed }}`"
|
|
2954
|
+
},
|
|
2955
|
+
type: "suggestion",
|
|
2956
|
+
fixable: "code",
|
|
2957
|
+
schema: []
|
|
2958
|
+
}
|
|
2959
|
+
};
|
|
2960
|
+
|
|
2961
|
+
// ../../node_modules/.pnpm/eslint-plugin-de-morgan@2.0.0_eslint@9.39.1_jiti@2.6.1_/node_modules/eslint-plugin-de-morgan/dist/index.js
|
|
2962
|
+
var pluginName = "de-morgan";
|
|
2963
|
+
var rules = {
|
|
2964
|
+
"no-negated-conjunction": noNegatedConjunction,
|
|
2965
|
+
"no-negated-disjunction": noNegatedDisjunction
|
|
2966
|
+
};
|
|
2967
|
+
function getRules() {
|
|
2968
|
+
return Object.fromEntries(
|
|
2969
|
+
Object.keys(rules).map((ruleName) => [`${pluginName}/${ruleName}`, "error"])
|
|
2970
|
+
);
|
|
2971
|
+
}
|
|
2972
|
+
function createConfig() {
|
|
2973
|
+
return {
|
|
2974
|
+
plugins: {
|
|
2975
|
+
[pluginName]: {
|
|
2976
|
+
rules
|
|
2977
|
+
}
|
|
2978
|
+
},
|
|
2979
|
+
rules: getRules()
|
|
2980
|
+
};
|
|
2981
|
+
}
|
|
2982
|
+
function createLegacyConfig() {
|
|
2983
|
+
return {
|
|
2984
|
+
plugins: [pluginName],
|
|
2985
|
+
rules: getRules()
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
var configs = {
|
|
2989
|
+
"recommended-legacy": createLegacyConfig(),
|
|
2990
|
+
recommended: createConfig()
|
|
2991
|
+
};
|
|
2992
|
+
var index = {
|
|
2993
|
+
meta: {
|
|
2994
|
+
version,
|
|
2995
|
+
name
|
|
2996
|
+
},
|
|
2997
|
+
configs,
|
|
2998
|
+
rules
|
|
2999
|
+
};
|
|
3000
|
+
|
|
3001
|
+
// src/configs/shared-js-ts.ts
|
|
2469
3002
|
import * as pluginDepend from "eslint-plugin-depend";
|
|
2470
3003
|
import pluginImport from "eslint-plugin-import-x";
|
|
2471
3004
|
import pluginJsdocComments from "eslint-plugin-jsdoc";
|
|
@@ -2515,10 +3048,14 @@ var kpPerfectionistSortConfig = [
|
|
|
2515
3048
|
generatePerfectionistSortConfig(["Start", "End"], "trailing"),
|
|
2516
3049
|
generatePerfectionistSortConfig(["min", "max"]),
|
|
2517
3050
|
generatePerfectionistSortConfig(["min", "max"], "leading"),
|
|
2518
|
-
generatePerfectionistSortConfig(["Min", "Max"], "trailing")
|
|
3051
|
+
generatePerfectionistSortConfig(["Min", "Max"], "trailing"),
|
|
3052
|
+
generatePerfectionistSortConfig(["pre", "post"]),
|
|
3053
|
+
generatePerfectionistSortConfig(["pre", "post"], "leading"),
|
|
3054
|
+
generatePerfectionistSortConfig(["Pre", "post"], "trailing")
|
|
2519
3055
|
];
|
|
2520
3056
|
var sharedScriptConfig = {
|
|
2521
3057
|
plugins: {
|
|
3058
|
+
"de-morgan": index,
|
|
2522
3059
|
depend: pluginDepend,
|
|
2523
3060
|
// eslint-disable-next-line ts/no-unsafe-assignment
|
|
2524
3061
|
"eslint-comments": pluginEslintComments,
|
|
@@ -2546,6 +3083,7 @@ var sharedScriptConfig = {
|
|
|
2546
3083
|
...jsdocCommentsRecommendedTypescriptRules,
|
|
2547
3084
|
...eslintCommentsRecommendedRules,
|
|
2548
3085
|
...regexpRecommendedRules,
|
|
3086
|
+
...deMorganRecommendedRules,
|
|
2549
3087
|
...dependRecommendedRules,
|
|
2550
3088
|
"capitalized-comments": [
|
|
2551
3089
|
"error",
|
|
@@ -2567,7 +3105,10 @@ var sharedScriptConfig = {
|
|
|
2567
3105
|
// Astro uses `astro:...` and `@astrojs/...`.
|
|
2568
3106
|
// Starlight uses `virtual:...`.
|
|
2569
3107
|
// https://github.com/hannoeru/vite-plugin-pages/issues/41#issuecomment-1371880072
|
|
2570
|
-
"import/no-unresolved": [
|
|
3108
|
+
"import/no-unresolved": [
|
|
3109
|
+
"error",
|
|
3110
|
+
{ ignore: ["^astro:", "^@astrojs", "^virtual:", "^~aphex/", "^~photos/"] }
|
|
3111
|
+
],
|
|
2571
3112
|
"import/order": "off",
|
|
2572
3113
|
// Conflicts with perfectionist/sort-imports (but never enabled)
|
|
2573
3114
|
// Knip workaround to ignore unused exported class members:
|
|
@@ -3206,10 +3747,10 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3206
3747
|
"[@kitschpatrol/eslint-config] Detected running in editor, some rules are disabled."
|
|
3207
3748
|
);
|
|
3208
3749
|
}
|
|
3209
|
-
const
|
|
3750
|
+
const configs2 = [];
|
|
3210
3751
|
if (enableGitignore) {
|
|
3211
3752
|
if (typeof enableGitignore === "boolean") {
|
|
3212
|
-
|
|
3753
|
+
configs2.push(
|
|
3213
3754
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
3214
3755
|
r({
|
|
3215
3756
|
name: "kp/gitignore",
|
|
@@ -3218,7 +3759,7 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3218
3759
|
])
|
|
3219
3760
|
);
|
|
3220
3761
|
} else {
|
|
3221
|
-
|
|
3762
|
+
configs2.push(
|
|
3222
3763
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
3223
3764
|
r({
|
|
3224
3765
|
name: "kp/gitignore",
|
|
@@ -3228,7 +3769,7 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3228
3769
|
);
|
|
3229
3770
|
}
|
|
3230
3771
|
}
|
|
3231
|
-
|
|
3772
|
+
configs2.push(
|
|
3232
3773
|
ignores(options.ignores),
|
|
3233
3774
|
[
|
|
3234
3775
|
{
|
|
@@ -3300,14 +3841,14 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3300
3841
|
})
|
|
3301
3842
|
);
|
|
3302
3843
|
if (enableReact) {
|
|
3303
|
-
|
|
3844
|
+
configs2.push(
|
|
3304
3845
|
react({
|
|
3305
3846
|
overrides: getOverrides(options, "react")
|
|
3306
3847
|
})
|
|
3307
3848
|
);
|
|
3308
3849
|
}
|
|
3309
3850
|
if (enableSvelte) {
|
|
3310
|
-
|
|
3851
|
+
configs2.push(
|
|
3311
3852
|
svelte({
|
|
3312
3853
|
overrides: getOverrides(options, "svelte")
|
|
3313
3854
|
// TODO TS flag?
|
|
@@ -3315,14 +3856,14 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3315
3856
|
);
|
|
3316
3857
|
}
|
|
3317
3858
|
if (enableAstro) {
|
|
3318
|
-
|
|
3859
|
+
configs2.push(
|
|
3319
3860
|
astro({
|
|
3320
3861
|
overrides: getOverrides(options, "astro"),
|
|
3321
3862
|
overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, "astro")
|
|
3322
3863
|
})
|
|
3323
3864
|
);
|
|
3324
3865
|
}
|
|
3325
|
-
|
|
3866
|
+
configs2.push(disables());
|
|
3326
3867
|
if ("files" in options) {
|
|
3327
3868
|
throw new Error(
|
|
3328
3869
|
'[@kitschpatrol/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.'
|
|
@@ -3332,9 +3873,9 @@ async function eslintConfig(options = {}, ...userConfigs) {
|
|
|
3332
3873
|
if (key in options) accumulator[key] = options[key];
|
|
3333
3874
|
return accumulator;
|
|
3334
3875
|
}, {});
|
|
3335
|
-
if (Object.keys(fusedConfig).length > 0)
|
|
3876
|
+
if (Object.keys(fusedConfig).length > 0) configs2.push([fusedConfig]);
|
|
3336
3877
|
let composer = new FlatConfigComposer();
|
|
3337
|
-
composer = composer.append(...
|
|
3878
|
+
composer = composer.append(...configs2, ...userConfigs);
|
|
3338
3879
|
composer = composer.renamePlugins(defaultPluginRenaming);
|
|
3339
3880
|
return composer;
|
|
3340
3881
|
}
|
|
@@ -3974,12 +4515,13 @@ async function svelte(options = {}) {
|
|
|
3974
4515
|
languageOptions: {
|
|
3975
4516
|
parser: parserSvelte,
|
|
3976
4517
|
parserOptions: {
|
|
3977
|
-
extraFileExtensions: [".svelte"],
|
|
4518
|
+
extraFileExtensions: [".svelte", ".svelte.ts"],
|
|
3978
4519
|
parser: tsParser,
|
|
3979
4520
|
// TODO js version?
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
4521
|
+
projectService: true,
|
|
4522
|
+
svelteConfig: path2.join(process4.cwd(), "svelte.config.js"),
|
|
4523
|
+
svelteFeatures: { experimentalGenerics: true },
|
|
4524
|
+
tsconfigRootDir: process4.cwd()
|
|
3983
4525
|
}
|
|
3984
4526
|
},
|
|
3985
4527
|
name: "kp/svelte/rules",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.1",
|
|
4
4
|
"description": "ESLint configuration for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
46
46
|
"@eslint-react/eslint-plugin": "2.1.1",
|
|
47
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
48
|
-
"@html-eslint/parser": "^0.
|
|
47
|
+
"@html-eslint/eslint-plugin": "^0.49.0",
|
|
48
|
+
"@html-eslint/parser": "^0.49.0",
|
|
49
49
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
51
|
-
"@typescript-eslint/parser": "^8.
|
|
52
|
-
"@vitest/eslint-plugin": "^1.
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
51
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
52
|
+
"@vitest/eslint-plugin": "^1.5.0",
|
|
53
53
|
"astro-eslint-parser": "^1.2.2",
|
|
54
54
|
"eslint": "^9.39.1",
|
|
55
55
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
58
58
|
"eslint-mdx": "^3.6.2",
|
|
59
59
|
"eslint-plugin-astro": "^1.5.0",
|
|
60
|
-
"eslint-plugin-depend": "^1.
|
|
60
|
+
"eslint-plugin-depend": "^1.4.0",
|
|
61
61
|
"eslint-plugin-html": "^8.1.3",
|
|
62
62
|
"eslint-plugin-import-x": "^4.16.1",
|
|
63
|
-
"eslint-plugin-jsdoc": "^61.1
|
|
63
|
+
"eslint-plugin-jsdoc": "^61.4.1",
|
|
64
64
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
65
65
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
66
66
|
"eslint-plugin-mdx": "^3.6.2",
|
|
67
67
|
"eslint-plugin-n": "^17.23.1",
|
|
68
68
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
69
|
-
"eslint-plugin-package-json": "^0.
|
|
69
|
+
"eslint-plugin-package-json": "^0.85.0",
|
|
70
70
|
"eslint-plugin-perfectionist": "^4.15.1",
|
|
71
71
|
"eslint-plugin-regexp": "^2.10.0",
|
|
72
72
|
"eslint-plugin-svelte": "^3.13.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"svelte-eslint-parser": "^1.4.0",
|
|
85
85
|
"to-valid-identifier": "^1.0.0",
|
|
86
86
|
"toml-eslint-parser": "^0.10.0",
|
|
87
|
-
"yaml-eslint-parser": "^1.3.
|
|
87
|
+
"yaml-eslint-parser": "^1.3.1"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
@@ -92,10 +92,11 @@
|
|
|
92
92
|
"dot-prop": "^10.1.0",
|
|
93
93
|
"eslint-config-prettier": "^10.1.8",
|
|
94
94
|
"eslint-config-xo-typescript": "^9.0.0",
|
|
95
|
+
"eslint-plugin-de-morgan": "^2.0.0",
|
|
95
96
|
"eslint-typegen": "^2.3.0",
|
|
96
97
|
"globby": "^15.0.0",
|
|
97
|
-
"svelte": "^5.
|
|
98
|
-
"tsup": "^8.5.
|
|
98
|
+
"svelte": "^5.44.1",
|
|
99
|
+
"tsup": "^8.5.1"
|
|
99
100
|
},
|
|
100
101
|
"engines": {
|
|
101
102
|
"node": ">=20.19.0"
|