@w5s/eslint-config 3.2.0 → 3.2.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/dist/index.d.ts +322 -148
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/typegen/jsdoc.d.ts +23 -0
- package/src/typegen/style.d.ts +2 -1
- package/src/typegen/test.d.ts +111 -5
- package/src/typegen/ts.d.ts +25 -0
- package/src/typegen/unicorn.d.ts +161 -142
package/dist/index.d.ts
CHANGED
|
@@ -831,6 +831,11 @@ interface RuleOptions$7 {
|
|
|
831
831
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
|
|
832
832
|
*/
|
|
833
833
|
'jsdoc/require-property-type'?: Linter.RuleEntry<[]>
|
|
834
|
+
/**
|
|
835
|
+
* Requires that Promise rejections are documented with `@rejects` tags.
|
|
836
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-rejects.md#repos-sticky-header
|
|
837
|
+
*/
|
|
838
|
+
'jsdoc/require-rejects'?: Linter.RuleEntry<JsdocRequireRejects>
|
|
834
839
|
/**
|
|
835
840
|
* Requires that returns are documented with `@returns`.
|
|
836
841
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
|
|
@@ -979,6 +984,8 @@ type JsdocCheckExamples = []|[{
|
|
|
979
984
|
// ----- jsdoc/check-indentation -----
|
|
980
985
|
type JsdocCheckIndentation = []|[{
|
|
981
986
|
|
|
987
|
+
allowIndentedSections?: boolean
|
|
988
|
+
|
|
982
989
|
excludeTags?: string[]
|
|
983
990
|
}]
|
|
984
991
|
// ----- jsdoc/check-line-alignment -----
|
|
@@ -1364,6 +1371,8 @@ type JsdocRequireHyphenBeforeParamDescription = []|[("always" | "never")]|[("alw
|
|
|
1364
1371
|
// ----- jsdoc/require-jsdoc -----
|
|
1365
1372
|
type JsdocRequireJsdoc = []|[{
|
|
1366
1373
|
|
|
1374
|
+
checkAllFunctionExpressions?: boolean
|
|
1375
|
+
|
|
1367
1376
|
checkConstructors?: boolean
|
|
1368
1377
|
|
|
1369
1378
|
checkGetters?: (boolean | "no-setter")
|
|
@@ -1484,6 +1493,16 @@ type JsdocRequireParamType = []|[{
|
|
|
1484
1493
|
|
|
1485
1494
|
setDefaultDestructuredRootType?: boolean
|
|
1486
1495
|
}]
|
|
1496
|
+
// ----- jsdoc/require-rejects -----
|
|
1497
|
+
type JsdocRequireRejects = []|[{
|
|
1498
|
+
|
|
1499
|
+
contexts?: (string | {
|
|
1500
|
+
comment?: string
|
|
1501
|
+
context?: string
|
|
1502
|
+
})[]
|
|
1503
|
+
|
|
1504
|
+
exemptedBy?: string[]
|
|
1505
|
+
}]
|
|
1487
1506
|
// ----- jsdoc/require-returns -----
|
|
1488
1507
|
type JsdocRequireReturns = []|[{
|
|
1489
1508
|
|
|
@@ -1608,6 +1627,10 @@ type JsdocSortTags = []|[{
|
|
|
1608
1627
|
|
|
1609
1628
|
reportTagGroupSpacing?: boolean
|
|
1610
1629
|
|
|
1630
|
+
tagExceptions?: {
|
|
1631
|
+
[k: string]: number
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1611
1634
|
tagSequence?: {
|
|
1612
1635
|
|
|
1613
1636
|
tags?: string[]
|
|
@@ -2994,6 +3017,7 @@ interface RuleOptions$4 {
|
|
|
2994
3017
|
/**
|
|
2995
3018
|
* Enforce props alphabetical sorting
|
|
2996
3019
|
* @see https://eslint.style/rules/jsx-sort-props
|
|
3020
|
+
* @deprecated
|
|
2997
3021
|
*/
|
|
2998
3022
|
'style/jsx-sort-props'?: Linter.RuleEntry<StyleJsxSortProps>
|
|
2999
3023
|
/**
|
|
@@ -4498,7 +4522,7 @@ type StyleTypeAnnotationSpacing = []|[{
|
|
|
4498
4522
|
after?: boolean
|
|
4499
4523
|
overrides?: {
|
|
4500
4524
|
colon?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
4501
|
-
arrow?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
4525
|
+
arrow?: ("ignore" | _StyleTypeAnnotationSpacing_SpacingConfig)
|
|
4502
4526
|
variable?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
4503
4527
|
parameter?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
4504
4528
|
property?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
@@ -4538,7 +4562,12 @@ declare module 'eslint' {
|
|
|
4538
4562
|
|
|
4539
4563
|
interface RuleOptions$3 {
|
|
4540
4564
|
/**
|
|
4541
|
-
*
|
|
4565
|
+
* enforce using `.each` or `.for` consistently
|
|
4566
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
|
|
4567
|
+
*/
|
|
4568
|
+
'test/consistent-each-for'?: Linter.RuleEntry<TestConsistentEachFor>
|
|
4569
|
+
/**
|
|
4570
|
+
* require test file pattern
|
|
4542
4571
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
4543
4572
|
*/
|
|
4544
4573
|
'test/consistent-test-filename'?: Linter.RuleEntry<TestConsistentTestFilename>
|
|
@@ -4547,11 +4576,21 @@ interface RuleOptions$3 {
|
|
|
4547
4576
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
|
|
4548
4577
|
*/
|
|
4549
4578
|
'test/consistent-test-it'?: Linter.RuleEntry<TestConsistentTestIt>
|
|
4579
|
+
/**
|
|
4580
|
+
* enforce using vitest or vi but not both
|
|
4581
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-vitest-vi.md
|
|
4582
|
+
*/
|
|
4583
|
+
'test/consistent-vitest-vi'?: Linter.RuleEntry<TestConsistentVitestVi>
|
|
4550
4584
|
/**
|
|
4551
4585
|
* enforce having expectation in test body
|
|
4552
4586
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
4553
4587
|
*/
|
|
4554
4588
|
'test/expect-expect'?: Linter.RuleEntry<TestExpectExpect>
|
|
4589
|
+
/**
|
|
4590
|
+
* enforce hoisted APIs to be on top of the file
|
|
4591
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
|
|
4592
|
+
*/
|
|
4593
|
+
'test/hoisted-apis-on-top'?: Linter.RuleEntry<[]>
|
|
4555
4594
|
/**
|
|
4556
4595
|
* enforce a maximum number of expect per test
|
|
4557
4596
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
@@ -4576,7 +4615,7 @@ interface RuleOptions$3 {
|
|
|
4576
4615
|
* disallow conditional expects
|
|
4577
4616
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
4578
4617
|
*/
|
|
4579
|
-
'test/no-conditional-expect'?: Linter.RuleEntry<
|
|
4618
|
+
'test/no-conditional-expect'?: Linter.RuleEntry<TestNoConditionalExpect>
|
|
4580
4619
|
/**
|
|
4581
4620
|
* disallow conditional tests
|
|
4582
4621
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
@@ -4623,6 +4662,11 @@ interface RuleOptions$3 {
|
|
|
4623
4662
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
|
|
4624
4663
|
*/
|
|
4625
4664
|
'test/no-import-node-test'?: Linter.RuleEntry<[]>
|
|
4665
|
+
/**
|
|
4666
|
+
* disallow importing Vitest globals
|
|
4667
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-importing-vitest-globals.md
|
|
4668
|
+
*/
|
|
4669
|
+
'test/no-importing-vitest-globals'?: Linter.RuleEntry<[]>
|
|
4626
4670
|
/**
|
|
4627
4671
|
* disallow string interpolation in snapshots
|
|
4628
4672
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
@@ -4654,7 +4698,7 @@ interface RuleOptions$3 {
|
|
|
4654
4698
|
*/
|
|
4655
4699
|
'test/no-standalone-expect'?: Linter.RuleEntry<TestNoStandaloneExpect>
|
|
4656
4700
|
/**
|
|
4657
|
-
* disallow using `
|
|
4701
|
+
* disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`
|
|
4658
4702
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
|
|
4659
4703
|
*/
|
|
4660
4704
|
'test/no-test-prefixes'?: Linter.RuleEntry<[]>
|
|
@@ -4663,6 +4707,11 @@ interface RuleOptions$3 {
|
|
|
4663
4707
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
4664
4708
|
*/
|
|
4665
4709
|
'test/no-test-return-statement'?: Linter.RuleEntry<[]>
|
|
4710
|
+
/**
|
|
4711
|
+
* Disallow unnecessary async function wrapper for expected promises
|
|
4712
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
|
|
4713
|
+
*/
|
|
4714
|
+
'test/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>
|
|
4666
4715
|
/**
|
|
4667
4716
|
* Enforce padding around `afterAll` blocks
|
|
4668
4717
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
@@ -4703,6 +4752,21 @@ interface RuleOptions$3 {
|
|
|
4703
4752
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
4704
4753
|
*/
|
|
4705
4754
|
'test/padding-around-test-blocks'?: Linter.RuleEntry<[]>
|
|
4755
|
+
/**
|
|
4756
|
+
* Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`
|
|
4757
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-exactly-once-with.md
|
|
4758
|
+
*/
|
|
4759
|
+
'test/prefer-called-exactly-once-with'?: Linter.RuleEntry<[]>
|
|
4760
|
+
/**
|
|
4761
|
+
* enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`
|
|
4762
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
|
|
4763
|
+
*/
|
|
4764
|
+
'test/prefer-called-once'?: Linter.RuleEntry<[]>
|
|
4765
|
+
/**
|
|
4766
|
+
* enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`
|
|
4767
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
|
|
4768
|
+
*/
|
|
4769
|
+
'test/prefer-called-times'?: Linter.RuleEntry<[]>
|
|
4706
4770
|
/**
|
|
4707
4771
|
* enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
4708
4772
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
@@ -4713,13 +4777,18 @@ interface RuleOptions$3 {
|
|
|
4713
4777
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
4714
4778
|
*/
|
|
4715
4779
|
'test/prefer-comparison-matcher'?: Linter.RuleEntry<[]>
|
|
4780
|
+
/**
|
|
4781
|
+
* enforce using a function as a describe title over an equivalent string
|
|
4782
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
|
|
4783
|
+
*/
|
|
4784
|
+
'test/prefer-describe-function-title'?: Linter.RuleEntry<[]>
|
|
4716
4785
|
/**
|
|
4717
4786
|
* enforce using `each` rather than manual loops
|
|
4718
4787
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
4719
4788
|
*/
|
|
4720
4789
|
'test/prefer-each'?: Linter.RuleEntry<[]>
|
|
4721
4790
|
/**
|
|
4722
|
-
* enforce using the built-in
|
|
4791
|
+
* enforce using the built-in equality matchers
|
|
4723
4792
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
4724
4793
|
*/
|
|
4725
4794
|
'test/prefer-equality-matcher'?: Linter.RuleEntry<[]>
|
|
@@ -4733,6 +4802,11 @@ interface RuleOptions$3 {
|
|
|
4733
4802
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
4734
4803
|
*/
|
|
4735
4804
|
'test/prefer-expect-resolves'?: Linter.RuleEntry<[]>
|
|
4805
|
+
/**
|
|
4806
|
+
* enforce using `expectTypeOf` instead of `expect(typeof ...)`
|
|
4807
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
|
|
4808
|
+
*/
|
|
4809
|
+
'test/prefer-expect-type-of'?: Linter.RuleEntry<[]>
|
|
4736
4810
|
/**
|
|
4737
4811
|
* enforce having hooks in consistent order
|
|
4738
4812
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
@@ -4743,6 +4817,16 @@ interface RuleOptions$3 {
|
|
|
4743
4817
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
4744
4818
|
*/
|
|
4745
4819
|
'test/prefer-hooks-on-top'?: Linter.RuleEntry<[]>
|
|
4820
|
+
/**
|
|
4821
|
+
* prefer dynamic import in mock
|
|
4822
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
|
|
4823
|
+
*/
|
|
4824
|
+
'test/prefer-import-in-mock'?: Linter.RuleEntry<TestPreferImportInMock>
|
|
4825
|
+
/**
|
|
4826
|
+
* enforce importing Vitest globals
|
|
4827
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
|
|
4828
|
+
*/
|
|
4829
|
+
'test/prefer-importing-vitest-globals'?: Linter.RuleEntry<[]>
|
|
4746
4830
|
/**
|
|
4747
4831
|
* enforce lowercase titles
|
|
4748
4832
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
@@ -4753,6 +4837,11 @@ interface RuleOptions$3 {
|
|
|
4753
4837
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
4754
4838
|
*/
|
|
4755
4839
|
'test/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>
|
|
4840
|
+
/**
|
|
4841
|
+
* Prefer mock return shorthands
|
|
4842
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
|
|
4843
|
+
*/
|
|
4844
|
+
'test/prefer-mock-return-shorthand'?: Linter.RuleEntry<[]>
|
|
4756
4845
|
/**
|
|
4757
4846
|
* enforce including a hint with external snapshots
|
|
4758
4847
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
@@ -4798,6 +4887,11 @@ interface RuleOptions$3 {
|
|
|
4798
4887
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
4799
4888
|
*/
|
|
4800
4889
|
'test/prefer-to-contain'?: Linter.RuleEntry<[]>
|
|
4890
|
+
/**
|
|
4891
|
+
* Suggest using `toHaveBeenCalledTimes()`
|
|
4892
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
|
|
4893
|
+
*/
|
|
4894
|
+
'test/prefer-to-have-been-called-times'?: Linter.RuleEntry<[]>
|
|
4801
4895
|
/**
|
|
4802
4896
|
* enforce using toHaveLength()
|
|
4803
4897
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
@@ -4813,6 +4907,11 @@ interface RuleOptions$3 {
|
|
|
4813
4907
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
4814
4908
|
*/
|
|
4815
4909
|
'test/prefer-vi-mocked'?: Linter.RuleEntry<[]>
|
|
4910
|
+
/**
|
|
4911
|
+
* ensure that every `expect.poll` call is awaited
|
|
4912
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
|
|
4913
|
+
*/
|
|
4914
|
+
'test/require-awaited-expect-poll'?: Linter.RuleEntry<[]>
|
|
4816
4915
|
/**
|
|
4817
4916
|
* require setup and teardown to be within a hook
|
|
4818
4917
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
@@ -4828,6 +4927,11 @@ interface RuleOptions$3 {
|
|
|
4828
4927
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-mock-type-parameters.md
|
|
4829
4928
|
*/
|
|
4830
4929
|
'test/require-mock-type-parameters'?: Linter.RuleEntry<TestRequireMockTypeParameters>
|
|
4930
|
+
/**
|
|
4931
|
+
* require tests to declare a timeout
|
|
4932
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-test-timeout.md
|
|
4933
|
+
*/
|
|
4934
|
+
'test/require-test-timeout'?: Linter.RuleEntry<[]>
|
|
4831
4935
|
/**
|
|
4832
4936
|
* require toThrow() to be called with an error message
|
|
4833
4937
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
|
|
@@ -4858,9 +4962,21 @@ interface RuleOptions$3 {
|
|
|
4858
4962
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
4859
4963
|
*/
|
|
4860
4964
|
'test/valid-title'?: Linter.RuleEntry<TestValidTitle>
|
|
4965
|
+
/**
|
|
4966
|
+
* disallow `.todo` usage
|
|
4967
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/warn-todo.md
|
|
4968
|
+
*/
|
|
4969
|
+
'test/warn-todo'?: Linter.RuleEntry<[]>
|
|
4861
4970
|
}
|
|
4862
4971
|
|
|
4863
4972
|
/* ======= Declarations ======= */
|
|
4973
|
+
// ----- test/consistent-each-for -----
|
|
4974
|
+
type TestConsistentEachFor = []|[{
|
|
4975
|
+
test?: ("each" | "for")
|
|
4976
|
+
it?: ("each" | "for")
|
|
4977
|
+
describe?: ("each" | "for")
|
|
4978
|
+
suite?: ("each" | "for")
|
|
4979
|
+
}]
|
|
4864
4980
|
// ----- test/consistent-test-filename -----
|
|
4865
4981
|
type TestConsistentTestFilename = []|[{
|
|
4866
4982
|
pattern?: string
|
|
@@ -4871,6 +4987,10 @@ type TestConsistentTestIt = []|[{
|
|
|
4871
4987
|
fn?: ("test" | "it")
|
|
4872
4988
|
withinDescribe?: ("test" | "it")
|
|
4873
4989
|
}]
|
|
4990
|
+
// ----- test/consistent-vitest-vi -----
|
|
4991
|
+
type TestConsistentVitestVi = []|[{
|
|
4992
|
+
fn?: ("vi" | "vitest")
|
|
4993
|
+
}]
|
|
4874
4994
|
// ----- test/expect-expect -----
|
|
4875
4995
|
type TestExpectExpect = []|[{
|
|
4876
4996
|
assertFunctionNames?: string[]
|
|
@@ -4884,13 +5004,19 @@ type TestMaxExpects = []|[{
|
|
|
4884
5004
|
type TestMaxNestedDescribe = []|[{
|
|
4885
5005
|
max?: number
|
|
4886
5006
|
}]
|
|
5007
|
+
// ----- test/no-conditional-expect -----
|
|
5008
|
+
type TestNoConditionalExpect = []|[{
|
|
5009
|
+
|
|
5010
|
+
expectAssertions?: boolean
|
|
5011
|
+
}]
|
|
4887
5012
|
// ----- test/no-focused-tests -----
|
|
4888
5013
|
type TestNoFocusedTests = []|[{
|
|
4889
5014
|
fixable?: boolean
|
|
4890
5015
|
}]
|
|
4891
5016
|
// ----- test/no-hooks -----
|
|
4892
5017
|
type TestNoHooks = []|[{
|
|
4893
|
-
|
|
5018
|
+
|
|
5019
|
+
allow?: ("beforeAll" | "beforeEach" | "afterAll" | "afterEach")[]
|
|
4894
5020
|
}]
|
|
4895
5021
|
// ----- test/no-large-snapshots -----
|
|
4896
5022
|
type TestNoLargeSnapshots = []|[{
|
|
@@ -4918,6 +5044,10 @@ type TestPreferExpectAssertions = []|[{
|
|
|
4918
5044
|
onlyFunctionsWithExpectInLoop?: boolean
|
|
4919
5045
|
onlyFunctionsWithExpectInCallback?: boolean
|
|
4920
5046
|
}]
|
|
5047
|
+
// ----- test/prefer-import-in-mock -----
|
|
5048
|
+
type TestPreferImportInMock = []|[{
|
|
5049
|
+
fixable?: boolean
|
|
5050
|
+
}]
|
|
4921
5051
|
// ----- test/prefer-lowercase-title -----
|
|
4922
5052
|
type TestPreferLowercaseTitle = []|[{
|
|
4923
5053
|
ignore?: ("describe" | "test" | "it")[]
|
|
@@ -5417,6 +5547,11 @@ interface RuleOptions$2 {
|
|
|
5417
5547
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
5418
5548
|
*/
|
|
5419
5549
|
'ts/no-unused-expressions'?: Linter.RuleEntry<TsNoUnusedExpressions>
|
|
5550
|
+
/**
|
|
5551
|
+
* Disallow unused private class members
|
|
5552
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
5553
|
+
*/
|
|
5554
|
+
'ts/no-unused-private-class-members'?: Linter.RuleEntry<[]>
|
|
5420
5555
|
/**
|
|
5421
5556
|
* Disallow unused variables
|
|
5422
5557
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -5432,6 +5567,11 @@ interface RuleOptions$2 {
|
|
|
5432
5567
|
* @see https://typescript-eslint.io/rules/no-useless-constructor
|
|
5433
5568
|
*/
|
|
5434
5569
|
'ts/no-useless-constructor'?: Linter.RuleEntry<[]>
|
|
5570
|
+
/**
|
|
5571
|
+
* Disallow default values that will never be used
|
|
5572
|
+
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
5573
|
+
*/
|
|
5574
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>
|
|
5435
5575
|
/**
|
|
5436
5576
|
* Disallow empty exports that don't change anything in a module file
|
|
5437
5577
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -5605,6 +5745,11 @@ interface RuleOptions$2 {
|
|
|
5605
5745
|
* @see https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
5606
5746
|
*/
|
|
5607
5747
|
'ts/strict-boolean-expressions'?: Linter.RuleEntry<TsStrictBooleanExpressions>
|
|
5748
|
+
/**
|
|
5749
|
+
* Disallow passing a value-returning function in a position accepting a void function
|
|
5750
|
+
* @see https://typescript-eslint.io/rules/strict-void-return
|
|
5751
|
+
*/
|
|
5752
|
+
'ts/strict-void-return'?: Linter.RuleEntry<TsStrictVoidReturn>
|
|
5608
5753
|
/**
|
|
5609
5754
|
* Require switch-case statements to be exhaustive
|
|
5610
5755
|
* @see https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
@@ -6499,6 +6644,11 @@ type TsNoUnusedVars = []|[(("all" | "local") | {
|
|
|
6499
6644
|
|
|
6500
6645
|
destructuredArrayIgnorePattern?: string
|
|
6501
6646
|
|
|
6647
|
+
enableAutofixRemoval?: {
|
|
6648
|
+
|
|
6649
|
+
imports?: boolean
|
|
6650
|
+
}
|
|
6651
|
+
|
|
6502
6652
|
ignoreClassWithStaticInitBlock?: boolean
|
|
6503
6653
|
|
|
6504
6654
|
ignoreRestSiblings?: boolean
|
|
@@ -6783,6 +6933,11 @@ type TsStrictBooleanExpressions = []|[{
|
|
|
6783
6933
|
|
|
6784
6934
|
allowString?: boolean
|
|
6785
6935
|
}]
|
|
6936
|
+
// ----- ts/strict-void-return -----
|
|
6937
|
+
type TsStrictVoidReturn = []|[{
|
|
6938
|
+
|
|
6939
|
+
allowReturnAny?: boolean
|
|
6940
|
+
}]
|
|
6786
6941
|
// ----- ts/switch-exhaustiveness-check -----
|
|
6787
6942
|
type TsSwitchExhaustivenessCheck = []|[{
|
|
6788
6943
|
|
|
@@ -6856,710 +7011,725 @@ declare module 'eslint' {
|
|
|
6856
7011
|
interface RuleOptions$1 {
|
|
6857
7012
|
/**
|
|
6858
7013
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
6859
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7014
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/better-regex.md
|
|
6860
7015
|
*/
|
|
6861
7016
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>
|
|
6862
7017
|
/**
|
|
6863
7018
|
* Enforce a specific parameter name in catch clauses.
|
|
6864
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7019
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/catch-error-name.md
|
|
6865
7020
|
*/
|
|
6866
7021
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
6867
7022
|
/**
|
|
6868
7023
|
* Enforce consistent assertion style with `node:assert`.
|
|
6869
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7024
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-assert.md
|
|
6870
7025
|
*/
|
|
6871
7026
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
6872
7027
|
/**
|
|
6873
7028
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6874
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7029
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-date-clone.md
|
|
6875
7030
|
*/
|
|
6876
7031
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
6877
7032
|
/**
|
|
6878
7033
|
* Use destructured variables over properties.
|
|
6879
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7034
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-destructuring.md
|
|
6880
7035
|
*/
|
|
6881
7036
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
6882
7037
|
/**
|
|
6883
7038
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6884
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7039
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-empty-array-spread.md
|
|
6885
7040
|
*/
|
|
6886
7041
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
6887
7042
|
/**
|
|
6888
7043
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6889
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7044
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-existence-index-check.md
|
|
6890
7045
|
*/
|
|
6891
7046
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
6892
7047
|
/**
|
|
6893
7048
|
* Move function definitions to the highest possible scope.
|
|
6894
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7049
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-function-scoping.md
|
|
6895
7050
|
*/
|
|
6896
7051
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
6897
7052
|
/**
|
|
6898
7053
|
* Enforce correct `Error` subclassing.
|
|
6899
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7054
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/custom-error-definition.md
|
|
6900
7055
|
*/
|
|
6901
7056
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
6902
7057
|
/**
|
|
6903
7058
|
* Enforce no spaces between braces.
|
|
6904
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7059
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/empty-brace-spaces.md
|
|
6905
7060
|
*/
|
|
6906
7061
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
6907
7062
|
/**
|
|
6908
7063
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6909
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7064
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/error-message.md
|
|
6910
7065
|
*/
|
|
6911
7066
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
6912
7067
|
/**
|
|
6913
7068
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6914
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7069
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/escape-case.md
|
|
6915
7070
|
*/
|
|
6916
7071
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
6917
7072
|
/**
|
|
6918
7073
|
* Add expiration conditions to TODO comments.
|
|
6919
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7074
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/expiring-todo-comments.md
|
|
6920
7075
|
*/
|
|
6921
7076
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
6922
7077
|
/**
|
|
6923
7078
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6924
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7079
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/explicit-length-check.md
|
|
6925
7080
|
*/
|
|
6926
7081
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
6927
7082
|
/**
|
|
6928
7083
|
* Enforce a case style for filenames.
|
|
6929
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7084
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/filename-case.md
|
|
6930
7085
|
*/
|
|
6931
7086
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
6932
7087
|
/**
|
|
6933
7088
|
* Enforce specific import styles per module.
|
|
6934
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7089
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/import-style.md
|
|
6935
7090
|
*/
|
|
6936
7091
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
6937
7092
|
/**
|
|
6938
7093
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6939
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7094
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/new-for-builtins.md
|
|
6940
7095
|
*/
|
|
6941
7096
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
6942
7097
|
/**
|
|
6943
7098
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6944
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7099
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
6945
7100
|
*/
|
|
6946
7101
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
6947
7102
|
/**
|
|
6948
7103
|
* Disallow recursive access to `this` within getters and setters.
|
|
6949
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7104
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-accessor-recursion.md
|
|
6950
7105
|
*/
|
|
6951
7106
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
6952
7107
|
/**
|
|
6953
7108
|
* Disallow anonymous functions and classes as the default export.
|
|
6954
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7109
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-anonymous-default-export.md
|
|
6955
7110
|
*/
|
|
6956
7111
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
6957
7112
|
/**
|
|
6958
7113
|
* Prevent passing a function reference directly to iterator methods.
|
|
6959
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7114
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-callback-reference.md
|
|
6960
7115
|
*/
|
|
6961
7116
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>
|
|
6962
7117
|
/**
|
|
6963
7118
|
* Prefer `for…of` over the `forEach` method.
|
|
6964
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7119
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-for-each.md
|
|
6965
7120
|
*/
|
|
6966
7121
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
6967
7122
|
/**
|
|
6968
7123
|
* Disallow using the `this` argument in array methods.
|
|
6969
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7124
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-method-this-argument.md
|
|
6970
7125
|
*/
|
|
6971
7126
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
6972
7127
|
/**
|
|
6973
7128
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6974
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7129
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
6975
7130
|
* @deprecated
|
|
6976
7131
|
*/
|
|
6977
7132
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
6978
7133
|
/**
|
|
6979
7134
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6980
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reduce.md
|
|
6981
7136
|
*/
|
|
6982
7137
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
6983
7138
|
/**
|
|
6984
7139
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6985
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reverse.md
|
|
6986
7141
|
*/
|
|
6987
7142
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>
|
|
6988
7143
|
/**
|
|
6989
7144
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6990
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-sort.md
|
|
6991
7146
|
*/
|
|
6992
7147
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>
|
|
6993
7148
|
/**
|
|
6994
7149
|
* Disallow member access from await expression.
|
|
6995
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-expression-member.md
|
|
6996
7151
|
*/
|
|
6997
7152
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
6998
7153
|
/**
|
|
6999
7154
|
* Disallow using `await` in `Promise` method parameters.
|
|
7000
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-in-promise-methods.md
|
|
7001
7156
|
*/
|
|
7002
7157
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
7003
7158
|
/**
|
|
7004
7159
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
7005
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7160
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-console-spaces.md
|
|
7006
7161
|
*/
|
|
7007
7162
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
7008
7163
|
/**
|
|
7009
7164
|
* Do not use `document.cookie` directly.
|
|
7010
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-document-cookie.md
|
|
7011
7166
|
*/
|
|
7012
7167
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
7013
7168
|
/**
|
|
7014
7169
|
* Disallow empty files.
|
|
7015
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-empty-file.md
|
|
7016
7171
|
*/
|
|
7017
7172
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>
|
|
7018
7173
|
/**
|
|
7019
7174
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
7020
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7175
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-for-loop.md
|
|
7021
7176
|
*/
|
|
7022
7177
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
7023
7178
|
/**
|
|
7024
7179
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
7025
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7180
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-hex-escape.md
|
|
7026
7181
|
*/
|
|
7027
7182
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
7183
|
+
/**
|
|
7184
|
+
* Disallow immediate mutation after variable assignment.
|
|
7185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-immediate-mutation.md
|
|
7186
|
+
*/
|
|
7187
|
+
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>
|
|
7028
7188
|
/**
|
|
7029
7189
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
7030
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
7031
7191
|
* @deprecated
|
|
7032
7192
|
*/
|
|
7033
7193
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
7034
7194
|
/**
|
|
7035
7195
|
* Disallow `instanceof` with built-in objects
|
|
7036
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-instanceof-builtins.md
|
|
7037
7197
|
*/
|
|
7038
7198
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
7039
7199
|
/**
|
|
7040
7200
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
7041
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-fetch-options.md
|
|
7042
7202
|
*/
|
|
7043
7203
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
7044
7204
|
/**
|
|
7045
7205
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
7046
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
7047
7207
|
*/
|
|
7048
7208
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
7049
7209
|
/**
|
|
7050
7210
|
* Disallow identifiers starting with `new` or `class`.
|
|
7051
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-keyword-prefix.md
|
|
7052
7212
|
*/
|
|
7053
7213
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
7054
7214
|
/**
|
|
7055
7215
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
7056
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
7057
7217
|
* @deprecated
|
|
7058
7218
|
*/
|
|
7059
7219
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
7060
7220
|
/**
|
|
7061
7221
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
7062
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7222
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-lonely-if.md
|
|
7063
7223
|
*/
|
|
7064
7224
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
7065
7225
|
/**
|
|
7066
7226
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
7067
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7227
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
7068
7228
|
*/
|
|
7069
7229
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
7070
7230
|
/**
|
|
7071
7231
|
* Disallow named usage of default import and export.
|
|
7072
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7232
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-named-default.md
|
|
7073
7233
|
*/
|
|
7074
7234
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
7075
7235
|
/**
|
|
7076
7236
|
* Disallow negated conditions.
|
|
7077
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7237
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negated-condition.md
|
|
7078
7238
|
*/
|
|
7079
7239
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
7080
7240
|
/**
|
|
7081
7241
|
* Disallow negated expression in equality check.
|
|
7082
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7242
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negation-in-equality-check.md
|
|
7083
7243
|
*/
|
|
7084
7244
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
7085
7245
|
/**
|
|
7086
7246
|
* Disallow nested ternary expressions.
|
|
7087
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7247
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-nested-ternary.md
|
|
7088
7248
|
*/
|
|
7089
7249
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
7090
7250
|
/**
|
|
7091
7251
|
* Disallow `new Array()`.
|
|
7092
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-array.md
|
|
7093
7253
|
*/
|
|
7094
7254
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
7095
7255
|
/**
|
|
7096
7256
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
7097
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-buffer.md
|
|
7098
7258
|
*/
|
|
7099
7259
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
7100
7260
|
/**
|
|
7101
7261
|
* Disallow the use of the `null` literal.
|
|
7102
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-null.md
|
|
7103
7263
|
*/
|
|
7104
7264
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
7105
7265
|
/**
|
|
7106
7266
|
* Disallow the use of objects as default parameters.
|
|
7107
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-object-as-default-parameter.md
|
|
7108
7268
|
*/
|
|
7109
7269
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
7110
7270
|
/**
|
|
7111
7271
|
* Disallow `process.exit()`.
|
|
7112
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-process-exit.md
|
|
7113
7273
|
*/
|
|
7114
7274
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
7115
7275
|
/**
|
|
7116
7276
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
7117
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
7118
7278
|
*/
|
|
7119
7279
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
7120
7280
|
/**
|
|
7121
7281
|
* Disallow classes that only have static members.
|
|
7122
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-static-only-class.md
|
|
7123
7283
|
*/
|
|
7124
7284
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
7125
7285
|
/**
|
|
7126
7286
|
* Disallow `then` property.
|
|
7127
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-thenable.md
|
|
7128
7288
|
*/
|
|
7129
7289
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
7130
7290
|
/**
|
|
7131
7291
|
* Disallow assigning `this` to a variable.
|
|
7132
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-this-assignment.md
|
|
7133
7293
|
*/
|
|
7134
7294
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
7135
7295
|
/**
|
|
7136
7296
|
* Disallow comparing `undefined` using `typeof`.
|
|
7137
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-typeof-undefined.md
|
|
7138
7298
|
*/
|
|
7139
7299
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
7140
7300
|
/**
|
|
7141
7301
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
7142
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7302
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
7143
7303
|
*/
|
|
7144
7304
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
7145
7305
|
/**
|
|
7146
7306
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
7147
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7307
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
7148
7308
|
*/
|
|
7149
7309
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
7150
7310
|
/**
|
|
7151
7311
|
* Disallow awaiting non-promise values.
|
|
7152
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7312
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-await.md
|
|
7153
7313
|
*/
|
|
7154
7314
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
7155
7315
|
/**
|
|
7156
7316
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
7157
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7317
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
7158
7318
|
*/
|
|
7159
7319
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
7160
7320
|
/**
|
|
7161
7321
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
7162
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7322
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
7163
7323
|
*/
|
|
7164
7324
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
7165
7325
|
/**
|
|
7166
7326
|
* Disallow unreadable array destructuring.
|
|
7167
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7327
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
7168
7328
|
*/
|
|
7169
7329
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
7170
7330
|
/**
|
|
7171
7331
|
* Disallow unreadable IIFEs.
|
|
7172
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7332
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-iife.md
|
|
7173
7333
|
*/
|
|
7174
7334
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
7175
7335
|
/**
|
|
7176
7336
|
* Disallow unused object properties.
|
|
7177
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7337
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unused-properties.md
|
|
7178
7338
|
*/
|
|
7179
7339
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
7340
|
+
/**
|
|
7341
|
+
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
7342
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-collection-argument.md
|
|
7343
|
+
*/
|
|
7344
|
+
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>
|
|
7180
7345
|
/**
|
|
7181
7346
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
7182
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7347
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
7183
7348
|
*/
|
|
7184
7349
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
7185
7350
|
/**
|
|
7186
7351
|
* Disallow useless fallback when spreading in object literals.
|
|
7187
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7352
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
7188
7353
|
*/
|
|
7189
7354
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
7190
7355
|
/**
|
|
7191
7356
|
* Disallow useless array length check.
|
|
7192
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7357
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-length-check.md
|
|
7193
7358
|
*/
|
|
7194
7359
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
7195
7360
|
/**
|
|
7196
7361
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
7197
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7362
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
7198
7363
|
*/
|
|
7199
7364
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
7200
7365
|
/**
|
|
7201
7366
|
* Disallow unnecessary spread.
|
|
7202
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7367
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-spread.md
|
|
7203
7368
|
*/
|
|
7204
7369
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
7205
7370
|
/**
|
|
7206
7371
|
* Disallow useless case in switch statements.
|
|
7207
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7372
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-switch-case.md
|
|
7208
7373
|
*/
|
|
7209
7374
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
7210
7375
|
/**
|
|
7211
7376
|
* Disallow useless `undefined`.
|
|
7212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7377
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-undefined.md
|
|
7213
7378
|
*/
|
|
7214
7379
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
7215
7380
|
/**
|
|
7216
7381
|
* Disallow number literals with zero fractions or dangling dots.
|
|
7217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7382
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-zero-fractions.md
|
|
7218
7383
|
*/
|
|
7219
7384
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
7220
7385
|
/**
|
|
7221
7386
|
* Enforce proper case for numeric literals.
|
|
7222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7387
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/number-literal-case.md
|
|
7223
7388
|
*/
|
|
7224
7389
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
7225
7390
|
/**
|
|
7226
7391
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
7227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7392
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/numeric-separators-style.md
|
|
7228
7393
|
*/
|
|
7229
7394
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
7230
7395
|
/**
|
|
7231
7396
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
7232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7397
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-add-event-listener.md
|
|
7233
7398
|
*/
|
|
7234
7399
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
7235
7400
|
/**
|
|
7236
7401
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
7237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7402
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-find.md
|
|
7238
7403
|
*/
|
|
7239
7404
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
7240
7405
|
/**
|
|
7241
7406
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
7242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7407
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat.md
|
|
7243
7408
|
*/
|
|
7244
7409
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
7245
7410
|
/**
|
|
7246
7411
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
7247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7412
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat-map.md
|
|
7248
7413
|
*/
|
|
7249
7414
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
7250
7415
|
/**
|
|
7251
7416
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
7252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7417
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-index-of.md
|
|
7253
7418
|
*/
|
|
7254
7419
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
7255
7420
|
/**
|
|
7256
7421
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
7257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7422
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-some.md
|
|
7258
7423
|
*/
|
|
7259
7424
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
7260
7425
|
/**
|
|
7261
7426
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
7262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7427
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-at.md
|
|
7263
7428
|
*/
|
|
7264
7429
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
7265
7430
|
/**
|
|
7266
7431
|
* Prefer `BigInt` literals over the constructor.
|
|
7267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7432
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-bigint-literals.md
|
|
7268
7433
|
*/
|
|
7269
7434
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>
|
|
7270
7435
|
/**
|
|
7271
7436
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
7272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7437
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
7273
7438
|
*/
|
|
7274
7439
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
7275
7440
|
/**
|
|
7276
7441
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
7277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7442
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-class-fields.md
|
|
7278
7443
|
*/
|
|
7279
7444
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>
|
|
7280
7445
|
/**
|
|
7281
7446
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
7282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7447
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-classlist-toggle.md
|
|
7283
7448
|
*/
|
|
7284
7449
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>
|
|
7285
7450
|
/**
|
|
7286
7451
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
7287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7452
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-code-point.md
|
|
7288
7453
|
*/
|
|
7289
7454
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
7290
7455
|
/**
|
|
7291
7456
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
7292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7457
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-date-now.md
|
|
7293
7458
|
*/
|
|
7294
7459
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
7295
7460
|
/**
|
|
7296
7461
|
* Prefer default parameters over reassignment.
|
|
7297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7462
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-default-parameters.md
|
|
7298
7463
|
*/
|
|
7299
7464
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
7300
7465
|
/**
|
|
7301
7466
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
7302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7467
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-append.md
|
|
7303
7468
|
*/
|
|
7304
7469
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
7305
7470
|
/**
|
|
7306
7471
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
7307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7472
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
7308
7473
|
*/
|
|
7309
7474
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
7310
7475
|
/**
|
|
7311
7476
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
7312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7477
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-remove.md
|
|
7313
7478
|
*/
|
|
7314
7479
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
7315
7480
|
/**
|
|
7316
7481
|
* Prefer `.textContent` over `.innerText`.
|
|
7317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7482
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
7318
7483
|
*/
|
|
7319
7484
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
7320
7485
|
/**
|
|
7321
7486
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
7322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7487
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-event-target.md
|
|
7323
7488
|
*/
|
|
7324
7489
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
7325
7490
|
/**
|
|
7326
7491
|
* Prefer `export…from` when re-exporting.
|
|
7327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7492
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-export-from.md
|
|
7328
7493
|
*/
|
|
7329
7494
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
7330
7495
|
/**
|
|
7331
7496
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
7332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7497
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-global-this.md
|
|
7333
7498
|
*/
|
|
7334
7499
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
7335
7500
|
/**
|
|
7336
7501
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
7337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7502
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-import-meta-properties.md
|
|
7338
7503
|
*/
|
|
7339
7504
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
7340
7505
|
/**
|
|
7341
7506
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
7342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7507
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-includes.md
|
|
7343
7508
|
*/
|
|
7344
7509
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
7345
7510
|
/**
|
|
7346
7511
|
* Prefer reading a JSON file as a buffer.
|
|
7347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7512
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
7348
7513
|
*/
|
|
7349
7514
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
7350
7515
|
/**
|
|
7351
7516
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
7352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7517
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
7353
7518
|
*/
|
|
7354
7519
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
7355
7520
|
/**
|
|
7356
7521
|
* Prefer using a logical operator over a ternary.
|
|
7357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7522
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
7358
7523
|
*/
|
|
7359
7524
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
7360
7525
|
/**
|
|
7361
7526
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
7362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7527
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-min-max.md
|
|
7363
7528
|
*/
|
|
7364
7529
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
7365
7530
|
/**
|
|
7366
7531
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
7367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7532
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-trunc.md
|
|
7368
7533
|
*/
|
|
7369
7534
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
7370
7535
|
/**
|
|
7371
7536
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
7372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7537
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
7373
7538
|
*/
|
|
7374
7539
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
7375
7540
|
/**
|
|
7376
7541
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
7377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7542
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-math-apis.md
|
|
7378
7543
|
*/
|
|
7379
7544
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
7380
7545
|
/**
|
|
7381
7546
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
7382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7547
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-module.md
|
|
7383
7548
|
*/
|
|
7384
7549
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
7385
7550
|
/**
|
|
7386
7551
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
7387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7552
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
7388
7553
|
*/
|
|
7389
7554
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
7390
7555
|
/**
|
|
7391
7556
|
* Prefer negative index over `.length - index` when possible.
|
|
7392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7557
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-negative-index.md
|
|
7393
7558
|
*/
|
|
7394
7559
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
7395
7560
|
/**
|
|
7396
7561
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
7397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7562
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-node-protocol.md
|
|
7398
7563
|
*/
|
|
7399
7564
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
7400
7565
|
/**
|
|
7401
7566
|
* Prefer `Number` static properties over global ones.
|
|
7402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7567
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-number-properties.md
|
|
7403
7568
|
*/
|
|
7404
7569
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
7405
7570
|
/**
|
|
7406
7571
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
7407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7572
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-object-from-entries.md
|
|
7408
7573
|
*/
|
|
7409
7574
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
7410
7575
|
/**
|
|
7411
7576
|
* Prefer omitting the `catch` binding parameter.
|
|
7412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7577
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
7413
7578
|
*/
|
|
7414
7579
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
7415
7580
|
/**
|
|
7416
7581
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
7417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7582
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-prototype-methods.md
|
|
7418
7583
|
*/
|
|
7419
7584
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
7420
7585
|
/**
|
|
7421
7586
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
7422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7587
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-query-selector.md
|
|
7423
7588
|
*/
|
|
7424
7589
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>
|
|
7425
7590
|
/**
|
|
7426
7591
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
7427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7592
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-reflect-apply.md
|
|
7428
7593
|
*/
|
|
7429
7594
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
7430
7595
|
/**
|
|
7431
7596
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
7432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7597
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-regexp-test.md
|
|
7433
7598
|
*/
|
|
7434
7599
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
7600
|
+
/**
|
|
7601
|
+
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
7602
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-response-static-json.md
|
|
7603
|
+
*/
|
|
7604
|
+
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>
|
|
7435
7605
|
/**
|
|
7436
7606
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
7437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7607
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-has.md
|
|
7438
7608
|
*/
|
|
7439
7609
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>
|
|
7440
7610
|
/**
|
|
7441
7611
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
7442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7612
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-size.md
|
|
7443
7613
|
*/
|
|
7444
7614
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
7445
7615
|
/**
|
|
7446
7616
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
7447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7617
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-single-call.md
|
|
7448
7618
|
*/
|
|
7449
7619
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
7450
7620
|
/**
|
|
7451
7621
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
7452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7622
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-spread.md
|
|
7453
7623
|
*/
|
|
7454
7624
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
7455
7625
|
/**
|
|
7456
7626
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
7457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7627
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-raw.md
|
|
7458
7628
|
*/
|
|
7459
7629
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
7460
7630
|
/**
|
|
7461
7631
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
7462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7632
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-replace-all.md
|
|
7463
7633
|
*/
|
|
7464
7634
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
7465
7635
|
/**
|
|
7466
7636
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
7467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7637
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-slice.md
|
|
7468
7638
|
*/
|
|
7469
7639
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
7470
7640
|
/**
|
|
7471
7641
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
7472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7642
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
7473
7643
|
*/
|
|
7474
7644
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
7475
7645
|
/**
|
|
7476
7646
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
7477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7647
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
7478
7648
|
*/
|
|
7479
7649
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
7480
7650
|
/**
|
|
7481
7651
|
* Prefer using `structuredClone` to create a deep clone.
|
|
7482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7652
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-structured-clone.md
|
|
7483
7653
|
*/
|
|
7484
7654
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
7485
7655
|
/**
|
|
7486
7656
|
* Prefer `switch` over multiple `else-if`.
|
|
7487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7657
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-switch.md
|
|
7488
7658
|
*/
|
|
7489
7659
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
7490
7660
|
/**
|
|
7491
7661
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
7492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7662
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-ternary.md
|
|
7493
7663
|
*/
|
|
7494
7664
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
7495
7665
|
/**
|
|
7496
7666
|
* Prefer top-level await over top-level promises and async function calls.
|
|
7497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7667
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-top-level-await.md
|
|
7498
7668
|
*/
|
|
7499
7669
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
7500
7670
|
/**
|
|
7501
7671
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
7502
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7672
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-type-error.md
|
|
7503
7673
|
*/
|
|
7504
7674
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
7505
7675
|
/**
|
|
7506
7676
|
* Prevent abbreviations.
|
|
7507
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7677
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prevent-abbreviations.md
|
|
7508
7678
|
*/
|
|
7509
7679
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
7510
7680
|
/**
|
|
7511
7681
|
* Enforce consistent relative URL style.
|
|
7512
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7682
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/relative-url-style.md
|
|
7513
7683
|
*/
|
|
7514
7684
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
7515
7685
|
/**
|
|
7516
7686
|
* Enforce using the separator argument with `Array#join()`.
|
|
7517
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7687
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-array-join-separator.md
|
|
7518
7688
|
*/
|
|
7519
7689
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
7520
7690
|
/**
|
|
7521
7691
|
* Require non-empty module attributes for imports and exports
|
|
7522
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7692
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-attributes.md
|
|
7523
7693
|
*/
|
|
7524
7694
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>
|
|
7525
7695
|
/**
|
|
7526
7696
|
* Require non-empty specifier list in import and export statements.
|
|
7527
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7697
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-specifiers.md
|
|
7528
7698
|
*/
|
|
7529
7699
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
7530
7700
|
/**
|
|
7531
7701
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
7532
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7702
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
7533
7703
|
*/
|
|
7534
7704
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
7535
7705
|
/**
|
|
7536
7706
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
7537
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7707
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-post-message-target-origin.md
|
|
7538
7708
|
*/
|
|
7539
7709
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
7540
7710
|
/**
|
|
7541
7711
|
* Enforce better string content.
|
|
7542
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7712
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/string-content.md
|
|
7543
7713
|
*/
|
|
7544
7714
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
7545
7715
|
/**
|
|
7546
7716
|
* Enforce consistent brace style for `case` clauses.
|
|
7547
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7717
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/switch-case-braces.md
|
|
7548
7718
|
*/
|
|
7549
7719
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
7550
7720
|
/**
|
|
7551
7721
|
* Fix whitespace-insensitive template indentation.
|
|
7552
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7722
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/template-indent.md
|
|
7553
7723
|
*/
|
|
7554
7724
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
7555
7725
|
/**
|
|
7556
7726
|
* Enforce consistent case for text encoding identifiers.
|
|
7557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7727
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/text-encoding-identifier-case.md
|
|
7558
7728
|
*/
|
|
7559
|
-
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<
|
|
7729
|
+
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>
|
|
7560
7730
|
/**
|
|
7561
7731
|
* Require `new` when creating an error.
|
|
7562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7732
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/throw-new-error.md
|
|
7563
7733
|
*/
|
|
7564
7734
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
7565
7735
|
}
|
|
@@ -7784,6 +7954,10 @@ type UnicornTemplateIndent = []|[{
|
|
|
7784
7954
|
selectors?: string[]
|
|
7785
7955
|
comments?: string[]
|
|
7786
7956
|
}]
|
|
7957
|
+
// ----- unicorn/text-encoding-identifier-case -----
|
|
7958
|
+
type UnicornTextEncodingIdentifierCase = []|[{
|
|
7959
|
+
withDash?: boolean
|
|
7960
|
+
}]
|
|
7787
7961
|
|
|
7788
7962
|
declare function unicorn(options?: unicorn.Options): Promise<[Config, Config, Config]>;
|
|
7789
7963
|
declare namespace unicorn {
|