@w5s/eslint-config 3.8.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +965 -231
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
- package/src/config/unicorn.ts +1 -12
- package/src/typegen/unicorn.d.ts +999 -232
- package/src/typegen/yml.d.ts +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -7728,918 +7728,1560 @@ declare module 'eslint' {
|
|
|
7728
7728
|
interface RuleOptions$1 {
|
|
7729
7729
|
/**
|
|
7730
7730
|
* Prefer better DOM traversal APIs.
|
|
7731
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/better-dom-traversing.md
|
|
7732
7732
|
*/
|
|
7733
7733
|
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
7734
7734
|
/**
|
|
7735
7735
|
* Removed. Prefer `eslint-plugin-regexp`
|
|
7736
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#better-regex
|
|
7737
7737
|
* @deprecated
|
|
7738
7738
|
*/
|
|
7739
7739
|
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
7740
7740
|
/**
|
|
7741
7741
|
* Enforce a specific parameter name in catch clauses.
|
|
7742
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7742
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/catch-error-name.md
|
|
7743
7743
|
*/
|
|
7744
7744
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
7745
|
+
/**
|
|
7746
|
+
* Enforce consistent class references in static methods.
|
|
7747
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/class-reference-in-static-methods.md
|
|
7748
|
+
*/
|
|
7749
|
+
'unicorn/class-reference-in-static-methods'?: Linter.RuleEntry<UnicornClassReferenceInStaticMethods>;
|
|
7750
|
+
/**
|
|
7751
|
+
* Enforce better comment content.
|
|
7752
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/comment-content.md
|
|
7753
|
+
*/
|
|
7754
|
+
'unicorn/comment-content'?: Linter.RuleEntry<UnicornCommentContent>;
|
|
7745
7755
|
/**
|
|
7746
7756
|
* Enforce consistent assertion style with `node:assert`.
|
|
7747
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7757
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-assert.md
|
|
7748
7758
|
*/
|
|
7749
7759
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
7760
|
+
/**
|
|
7761
|
+
* Enforce consistent naming for boolean names.
|
|
7762
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-boolean-name.md
|
|
7763
|
+
*/
|
|
7764
|
+
'unicorn/consistent-boolean-name'?: Linter.RuleEntry<UnicornConsistentBooleanName>;
|
|
7765
|
+
/**
|
|
7766
|
+
* Enforce consistent class member order.
|
|
7767
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-class-member-order.md
|
|
7768
|
+
*/
|
|
7769
|
+
'unicorn/consistent-class-member-order'?: Linter.RuleEntry<UnicornConsistentClassMemberOrder>;
|
|
7750
7770
|
/**
|
|
7751
7771
|
* Enforce consistent spelling of compound words in identifiers.
|
|
7752
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7772
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-compound-words.md
|
|
7753
7773
|
*/
|
|
7754
7774
|
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
7775
|
+
/**
|
|
7776
|
+
* Enforce consistent conditional object spread style.
|
|
7777
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-conditional-object-spread.md
|
|
7778
|
+
*/
|
|
7779
|
+
'unicorn/consistent-conditional-object-spread'?: Linter.RuleEntry<UnicornConsistentConditionalObjectSpread>;
|
|
7755
7780
|
/**
|
|
7756
7781
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
7757
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7782
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-date-clone.md
|
|
7758
7783
|
*/
|
|
7759
7784
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
7760
7785
|
/**
|
|
7761
7786
|
* Use destructured variables over properties.
|
|
7762
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7787
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-destructuring.md
|
|
7763
7788
|
*/
|
|
7764
7789
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
7765
7790
|
/**
|
|
7766
7791
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
7767
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7792
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-empty-array-spread.md
|
|
7768
7793
|
*/
|
|
7769
7794
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
7770
7795
|
/**
|
|
7771
7796
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
7772
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7797
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-existence-index-check.md
|
|
7773
7798
|
*/
|
|
7774
7799
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
7800
|
+
/**
|
|
7801
|
+
* Enforce consistent decorator position on exported classes.
|
|
7802
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-export-decorator-position.md
|
|
7803
|
+
*/
|
|
7804
|
+
'unicorn/consistent-export-decorator-position'?: Linter.RuleEntry<UnicornConsistentExportDecoratorPosition>;
|
|
7775
7805
|
/**
|
|
7776
7806
|
* Move function definitions to the highest possible scope.
|
|
7777
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7807
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-function-scoping.md
|
|
7778
7808
|
*/
|
|
7779
7809
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
7810
|
+
/**
|
|
7811
|
+
* Enforce function syntax by role.
|
|
7812
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-function-style.md
|
|
7813
|
+
*/
|
|
7814
|
+
'unicorn/consistent-function-style'?: Linter.RuleEntry<UnicornConsistentFunctionStyle>;
|
|
7780
7815
|
/**
|
|
7781
7816
|
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
7782
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7817
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-json-file-read.md
|
|
7783
7818
|
*/
|
|
7784
7819
|
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
7820
|
+
/**
|
|
7821
|
+
* Enforce consistent optional chaining for same-base member access.
|
|
7822
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-optional-chaining.md
|
|
7823
|
+
*/
|
|
7824
|
+
'unicorn/consistent-optional-chaining'?: Linter.RuleEntry<[]>;
|
|
7785
7825
|
/**
|
|
7786
7826
|
* Enforce consistent style for escaping `${` in template literals.
|
|
7787
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7827
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-template-literal-escape.md
|
|
7788
7828
|
*/
|
|
7789
7829
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
7790
7830
|
/**
|
|
7791
7831
|
* Enforce correct `Error` subclassing.
|
|
7792
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7832
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/custom-error-definition.md
|
|
7793
7833
|
*/
|
|
7794
7834
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
7835
|
+
/**
|
|
7836
|
+
* Enforce consistent default export declarations.
|
|
7837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/default-export-style.md
|
|
7838
|
+
*/
|
|
7839
|
+
'unicorn/default-export-style'?: Linter.RuleEntry<UnicornDefaultExportStyle>;
|
|
7795
7840
|
/**
|
|
7796
7841
|
* Enforce consistent style for DOM element dataset access.
|
|
7797
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/dom-node-dataset.md
|
|
7798
7843
|
*/
|
|
7799
7844
|
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
7800
7845
|
/**
|
|
7801
7846
|
* Enforce no spaces between braces.
|
|
7802
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/empty-brace-spaces.md
|
|
7803
7848
|
*/
|
|
7804
7849
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
7805
7850
|
/**
|
|
7806
7851
|
* Enforce passing a `message` value when creating a built-in error.
|
|
7807
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/error-message.md
|
|
7808
7853
|
*/
|
|
7809
7854
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
7810
7855
|
/**
|
|
7811
7856
|
* Require escape sequences to use uppercase or lowercase values.
|
|
7812
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/escape-case.md
|
|
7813
7858
|
*/
|
|
7814
7859
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
7815
7860
|
/**
|
|
7816
7861
|
* Add expiration conditions to TODO comments.
|
|
7817
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7862
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/expiring-todo-comments.md
|
|
7818
7863
|
*/
|
|
7819
7864
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
7820
7865
|
/**
|
|
7821
7866
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
7822
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7867
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/explicit-length-check.md
|
|
7823
7868
|
*/
|
|
7824
7869
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
7870
|
+
/**
|
|
7871
|
+
* Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.
|
|
7872
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/explicit-timer-delay.md
|
|
7873
|
+
*/
|
|
7874
|
+
'unicorn/explicit-timer-delay'?: Linter.RuleEntry<UnicornExplicitTimerDelay>;
|
|
7825
7875
|
/**
|
|
7826
7876
|
* Enforce a case style for filenames and directory names.
|
|
7827
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7877
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/filename-case.md
|
|
7828
7878
|
*/
|
|
7829
7879
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
7880
|
+
/**
|
|
7881
|
+
* Require identifiers to match a specified regular expression.
|
|
7882
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/id-match.md
|
|
7883
|
+
*/
|
|
7884
|
+
'unicorn/id-match'?: Linter.RuleEntry<UnicornIdMatch>;
|
|
7830
7885
|
/**
|
|
7831
7886
|
* Enforce specific import styles per module.
|
|
7832
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7887
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/import-style.md
|
|
7833
7888
|
*/
|
|
7834
7889
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
7835
7890
|
/**
|
|
7836
7891
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
7837
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7892
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/isolated-functions.md
|
|
7838
7893
|
*/
|
|
7839
7894
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
7840
7895
|
/**
|
|
7841
|
-
*
|
|
7842
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7896
|
+
* Require or disallow logical assignment operator shorthand
|
|
7897
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/logical-assignment-operators.md
|
|
7898
|
+
*/
|
|
7899
|
+
'unicorn/logical-assignment-operators'?: Linter.RuleEntry<UnicornLogicalAssignmentOperators>;
|
|
7900
|
+
/**
|
|
7901
|
+
* Limit the depth of nested calls.
|
|
7902
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/max-nested-calls.md
|
|
7903
|
+
*/
|
|
7904
|
+
'unicorn/max-nested-calls'?: Linter.RuleEntry<UnicornMaxNestedCalls>;
|
|
7905
|
+
/**
|
|
7906
|
+
* Enforce replacements for variable, property, and filenames.
|
|
7907
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/name-replacements.md
|
|
7908
|
+
*/
|
|
7909
|
+
'unicorn/name-replacements'?: Linter.RuleEntry<UnicornNameReplacements>;
|
|
7910
|
+
/**
|
|
7911
|
+
* Enforce correct use of `new` for builtin constructors.
|
|
7912
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/new-for-builtins.md
|
|
7843
7913
|
*/
|
|
7844
7914
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
7845
7915
|
/**
|
|
7846
7916
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
7847
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7917
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
7848
7918
|
*/
|
|
7849
7919
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
7850
7920
|
/**
|
|
7851
7921
|
* Disallow recursive access to `this` within getters and setters.
|
|
7852
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7922
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-accessor-recursion.md
|
|
7853
7923
|
*/
|
|
7854
7924
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
7925
|
+
/**
|
|
7926
|
+
* Disallow bitwise operators where a logical operator was likely intended.
|
|
7927
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-accidental-bitwise-operator.md
|
|
7928
|
+
*/
|
|
7929
|
+
'unicorn/no-accidental-bitwise-operator'?: Linter.RuleEntry<[]>;
|
|
7855
7930
|
/**
|
|
7856
7931
|
* Disallow anonymous functions and classes as the default export.
|
|
7857
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7932
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-anonymous-default-export.md
|
|
7858
7933
|
*/
|
|
7859
7934
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
7860
7935
|
/**
|
|
7861
7936
|
* Prevent passing a function reference directly to iterator methods.
|
|
7862
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7937
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-callback-reference.md
|
|
7863
7938
|
*/
|
|
7864
7939
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
7865
7940
|
/**
|
|
7866
|
-
* Disallow
|
|
7867
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7941
|
+
* Disallow array accumulation with `Array#concat()` in loops.
|
|
7942
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-concat-in-loop.md
|
|
7868
7943
|
*/
|
|
7869
|
-
'unicorn/no-array-
|
|
7944
|
+
'unicorn/no-array-concat-in-loop'?: Linter.RuleEntry<[]>;
|
|
7870
7945
|
/**
|
|
7871
|
-
*
|
|
7872
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7946
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
7947
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-fill-with-reference-type.md
|
|
7873
7948
|
*/
|
|
7874
|
-
'unicorn/no-array-
|
|
7949
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
7875
7950
|
/**
|
|
7876
7951
|
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
7877
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7952
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-from-fill.md
|
|
7878
7953
|
*/
|
|
7879
7954
|
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
7955
|
+
/**
|
|
7956
|
+
* Disallow front-of-array mutation.
|
|
7957
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-front-mutation.md
|
|
7958
|
+
*/
|
|
7959
|
+
'unicorn/no-array-front-mutation'?: Linter.RuleEntry<[]>;
|
|
7880
7960
|
/**
|
|
7881
7961
|
* Disallow using the `this` argument in array methods.
|
|
7882
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7962
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-method-this-argument.md
|
|
7883
7963
|
*/
|
|
7884
7964
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
7885
7965
|
/**
|
|
7886
7966
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
7887
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7967
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
7888
7968
|
* @deprecated
|
|
7889
7969
|
*/
|
|
7890
7970
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
7891
7971
|
/**
|
|
7892
7972
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
7893
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7973
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-reduce.md
|
|
7894
7974
|
*/
|
|
7895
7975
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
7896
7976
|
/**
|
|
7897
7977
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
7898
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7978
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-reverse.md
|
|
7899
7979
|
*/
|
|
7900
7980
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
7901
7981
|
/**
|
|
7902
7982
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
7903
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7983
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-sort.md
|
|
7904
7984
|
*/
|
|
7905
7985
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
7986
|
+
/**
|
|
7987
|
+
* Disallow sorting arrays to get the minimum or maximum value.
|
|
7988
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-sort-for-min-max.md
|
|
7989
|
+
*/
|
|
7990
|
+
'unicorn/no-array-sort-for-min-max'?: Linter.RuleEntry<[]>;
|
|
7991
|
+
/**
|
|
7992
|
+
* Prefer `Array#toSpliced()` over `Array#splice()`.
|
|
7993
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-splice.md
|
|
7994
|
+
*/
|
|
7995
|
+
'unicorn/no-array-splice'?: Linter.RuleEntry<[]>;
|
|
7996
|
+
/**
|
|
7997
|
+
* Disallow asterisk prefixes in documentation comments.
|
|
7998
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-asterisk-prefix-in-documentation-comments.md
|
|
7999
|
+
*/
|
|
8000
|
+
'unicorn/no-asterisk-prefix-in-documentation-comments'?: Linter.RuleEntry<[]>;
|
|
7906
8001
|
/**
|
|
7907
8002
|
* Disallow member access from await expression.
|
|
7908
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8003
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-await-expression-member.md
|
|
7909
8004
|
*/
|
|
7910
8005
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
7911
8006
|
/**
|
|
7912
8007
|
* Disallow using `await` in `Promise` method parameters.
|
|
7913
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8008
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-await-in-promise-methods.md
|
|
7914
8009
|
*/
|
|
7915
8010
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
7916
8011
|
/**
|
|
7917
8012
|
* Disallow unnecessary `Blob` to `File` conversion.
|
|
7918
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8013
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-blob-to-file.md
|
|
7919
8014
|
*/
|
|
7920
8015
|
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
8016
|
+
/**
|
|
8017
|
+
* Disallow boolean-returning sort comparators.
|
|
8018
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-boolean-sort-comparator.md
|
|
8019
|
+
*/
|
|
8020
|
+
'unicorn/no-boolean-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
8021
|
+
/**
|
|
8022
|
+
* Disallow `break` and `continue` in nested loops and switches inside loops.
|
|
8023
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-break-in-nested-loop.md
|
|
8024
|
+
*/
|
|
8025
|
+
'unicorn/no-break-in-nested-loop'?: Linter.RuleEntry<[]>;
|
|
7921
8026
|
/**
|
|
7922
8027
|
* Prefer drawing canvases directly instead of converting them to images.
|
|
7923
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8028
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-canvas-to-image.md
|
|
7924
8029
|
*/
|
|
7925
8030
|
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
8031
|
+
/**
|
|
8032
|
+
* Disallow chained comparisons such as `a < b < c`.
|
|
8033
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-chained-comparison.md
|
|
8034
|
+
*/
|
|
8035
|
+
'unicorn/no-chained-comparison'?: Linter.RuleEntry<[]>;
|
|
8036
|
+
/**
|
|
8037
|
+
* Disallow accessing `Map`, `Set`, `WeakMap`, and `WeakSet` entries with bracket notation.
|
|
8038
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-collection-bracket-access.md
|
|
8039
|
+
*/
|
|
8040
|
+
'unicorn/no-collection-bracket-access'?: Linter.RuleEntry<[]>;
|
|
8041
|
+
/**
|
|
8042
|
+
* Disallow dynamic object property existence checks.
|
|
8043
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-computed-property-existence-check.md
|
|
8044
|
+
*/
|
|
8045
|
+
'unicorn/no-computed-property-existence-check'?: Linter.RuleEntry<[]>;
|
|
7926
8046
|
/**
|
|
7927
8047
|
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
7928
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8048
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-confusing-array-splice.md
|
|
7929
8049
|
*/
|
|
7930
8050
|
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
8051
|
+
/**
|
|
8052
|
+
* Disallow confusing uses of `Array#with()`.
|
|
8053
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-confusing-array-with.md
|
|
8054
|
+
*/
|
|
8055
|
+
'unicorn/no-confusing-array-with'?: Linter.RuleEntry<[]>;
|
|
7931
8056
|
/**
|
|
7932
8057
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
7933
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8058
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-console-spaces.md
|
|
7934
8059
|
*/
|
|
7935
8060
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
8061
|
+
/**
|
|
8062
|
+
* Disallow arithmetic and bitwise operations that always evaluate to `0`.
|
|
8063
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-constant-zero-expression.md
|
|
8064
|
+
*/
|
|
8065
|
+
'unicorn/no-constant-zero-expression'?: Linter.RuleEntry<[]>;
|
|
8066
|
+
/**
|
|
8067
|
+
* Disallow declarations before conditional early exits when they are only used after the exit.
|
|
8068
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-declarations-before-early-exit.md
|
|
8069
|
+
*/
|
|
8070
|
+
'unicorn/no-declarations-before-early-exit'?: Linter.RuleEntry<[]>;
|
|
7936
8071
|
/**
|
|
7937
8072
|
* Do not use `document.cookie` directly.
|
|
7938
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8073
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-document-cookie.md
|
|
7939
8074
|
*/
|
|
7940
8075
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
8076
|
+
/**
|
|
8077
|
+
* Disallow two comparisons of the same operands that can be combined into one.
|
|
8078
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-double-comparison.md
|
|
8079
|
+
*/
|
|
8080
|
+
'unicorn/no-double-comparison'?: Linter.RuleEntry<[]>;
|
|
8081
|
+
/**
|
|
8082
|
+
* Disallow duplicate adjacent branches in if chains.
|
|
8083
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-if-branches.md
|
|
8084
|
+
*/
|
|
8085
|
+
'unicorn/no-duplicate-if-branches'?: Linter.RuleEntry<[]>;
|
|
8086
|
+
/**
|
|
8087
|
+
* Disallow adjacent duplicate operands in logical expressions.
|
|
8088
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-logical-operands.md
|
|
8089
|
+
*/
|
|
8090
|
+
'unicorn/no-duplicate-logical-operands'?: Linter.RuleEntry<[]>;
|
|
8091
|
+
/**
|
|
8092
|
+
* Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.
|
|
8093
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-loops.md
|
|
8094
|
+
*/
|
|
8095
|
+
'unicorn/no-duplicate-loops'?: Linter.RuleEntry<[]>;
|
|
7941
8096
|
/**
|
|
7942
8097
|
* Disallow duplicate values in `Set` constructor array literals.
|
|
7943
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-set-values.md
|
|
7944
8099
|
*/
|
|
7945
8100
|
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
7946
8101
|
/**
|
|
7947
8102
|
* Disallow empty files.
|
|
7948
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-empty-file.md
|
|
7949
8104
|
*/
|
|
7950
8105
|
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
8106
|
+
/**
|
|
8107
|
+
* Disallow assigning to built-in error properties.
|
|
8108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-error-property-assignment.md
|
|
8109
|
+
*/
|
|
8110
|
+
'unicorn/no-error-property-assignment'?: Linter.RuleEntry<[]>;
|
|
7951
8111
|
/**
|
|
7952
8112
|
* Disallow exports in scripts.
|
|
7953
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-exports-in-scripts.md
|
|
7954
8114
|
*/
|
|
7955
8115
|
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
8116
|
+
/**
|
|
8117
|
+
* Prefer `for…of` over the `forEach` method.
|
|
8118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-for-each.md
|
|
8119
|
+
*/
|
|
8120
|
+
'unicorn/no-for-each'?: Linter.RuleEntry<[]>;
|
|
7956
8121
|
/**
|
|
7957
8122
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
7958
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-for-loop.md
|
|
7959
8124
|
*/
|
|
7960
8125
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
7961
8126
|
/**
|
|
7962
|
-
*
|
|
7963
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8127
|
+
* Disallow assigning properties on the global object.
|
|
8128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-global-object-property-assignment.md
|
|
8129
|
+
*/
|
|
8130
|
+
'unicorn/no-global-object-property-assignment'?: Linter.RuleEntry<[]>;
|
|
8131
|
+
/**
|
|
8132
|
+
* Replaced by `unicorn/prefer-unicode-code-point-escapes` which covers more cases.
|
|
8133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-hex-escape
|
|
8134
|
+
* @deprecated
|
|
7964
8135
|
*/
|
|
7965
8136
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
7966
8137
|
/**
|
|
7967
8138
|
* Disallow immediate mutation after variable assignment.
|
|
7968
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8139
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-immediate-mutation.md
|
|
7969
8140
|
*/
|
|
7970
8141
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
8142
|
+
/**
|
|
8143
|
+
* Disallow impossible comparisons against `.length` or `.size`.
|
|
8144
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-impossible-length-comparison.md
|
|
8145
|
+
*/
|
|
8146
|
+
'unicorn/no-impossible-length-comparison'?: Linter.RuleEntry<[]>;
|
|
7971
8147
|
/**
|
|
7972
8148
|
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
7973
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8149
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-incorrect-query-selector.md
|
|
7974
8150
|
*/
|
|
7975
8151
|
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
8152
|
+
/**
|
|
8153
|
+
* Disallow incorrect template literal interpolation syntax.
|
|
8154
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-incorrect-template-string-interpolation.md
|
|
8155
|
+
*/
|
|
8156
|
+
'unicorn/no-incorrect-template-string-interpolation'?: Linter.RuleEntry<[]>;
|
|
7976
8157
|
/**
|
|
7977
8158
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
7978
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8159
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
7979
8160
|
* @deprecated
|
|
7980
8161
|
*/
|
|
7981
8162
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
7982
8163
|
/**
|
|
7983
8164
|
* Disallow `instanceof` with built-in objects
|
|
7984
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-instanceof-builtins.md
|
|
7985
8166
|
*/
|
|
7986
8167
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
8168
|
+
/**
|
|
8169
|
+
* Disallow calling functions and constructors with an invalid number of arguments.
|
|
8170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-argument-count.md
|
|
8171
|
+
*/
|
|
8172
|
+
'unicorn/no-invalid-argument-count'?: Linter.RuleEntry<UnicornNoInvalidArgumentCount>;
|
|
8173
|
+
/**
|
|
8174
|
+
* Disallow comparing a single character from a string to a multi-character string.
|
|
8175
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-character-comparison.md
|
|
8176
|
+
*/
|
|
8177
|
+
'unicorn/no-invalid-character-comparison'?: Linter.RuleEntry<[]>;
|
|
7987
8178
|
/**
|
|
7988
8179
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
7989
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8180
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-fetch-options.md
|
|
7990
8181
|
*/
|
|
7991
8182
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
7992
8183
|
/**
|
|
7993
8184
|
* Disallow invalid `accept` values on file inputs.
|
|
7994
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-file-input-accept.md
|
|
7995
8186
|
*/
|
|
7996
8187
|
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
7997
8188
|
/**
|
|
7998
8189
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
7999
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
8000
8191
|
*/
|
|
8001
8192
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
8002
8193
|
/**
|
|
8003
8194
|
* Disallow identifiers starting with `new` or `class`.
|
|
8004
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8195
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-keyword-prefix.md
|
|
8005
8196
|
*/
|
|
8006
8197
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
8007
8198
|
/**
|
|
8008
8199
|
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
8009
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-late-current-target-access.md
|
|
8010
8201
|
*/
|
|
8011
8202
|
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
8012
8203
|
/**
|
|
8013
8204
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
8014
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8205
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
8015
8206
|
* @deprecated
|
|
8016
8207
|
*/
|
|
8017
8208
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
8018
8209
|
/**
|
|
8019
8210
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
8020
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-lonely-if.md
|
|
8021
8212
|
*/
|
|
8022
8213
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
8214
|
+
/**
|
|
8215
|
+
* Disallow mutating a loop iterable during iteration.
|
|
8216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-loop-iterable-mutation.md
|
|
8217
|
+
*/
|
|
8218
|
+
'unicorn/no-loop-iterable-mutation'?: Linter.RuleEntry<[]>;
|
|
8023
8219
|
/**
|
|
8024
8220
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
8025
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
8026
8222
|
*/
|
|
8027
8223
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
8028
8224
|
/**
|
|
8029
8225
|
* Disallow manually wrapped comments.
|
|
8030
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-manually-wrapped-comments.md
|
|
8031
8227
|
*/
|
|
8032
8228
|
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
8229
|
+
/**
|
|
8230
|
+
* Disallow checking a Map key before accessing a different key.
|
|
8231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-mismatched-map-key.md
|
|
8232
|
+
*/
|
|
8233
|
+
'unicorn/no-mismatched-map-key'?: Linter.RuleEntry<[]>;
|
|
8234
|
+
/**
|
|
8235
|
+
* Disallow misrefactored compound assignments where the target is duplicated in the right-hand side.
|
|
8236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-misrefactored-assignment.md
|
|
8237
|
+
*/
|
|
8238
|
+
'unicorn/no-misrefactored-assignment'?: Linter.RuleEntry<[]>;
|
|
8033
8239
|
/**
|
|
8034
8240
|
* Disallow named usage of default import and export.
|
|
8035
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-named-default.md
|
|
8036
8242
|
*/
|
|
8037
8243
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
8244
|
+
/**
|
|
8245
|
+
* Disallow negated array predicate calls.
|
|
8246
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-array-predicate.md
|
|
8247
|
+
*/
|
|
8248
|
+
'unicorn/no-negated-array-predicate'?: Linter.RuleEntry<[]>;
|
|
8249
|
+
/**
|
|
8250
|
+
* Disallow negated comparisons.
|
|
8251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-comparison.md
|
|
8252
|
+
*/
|
|
8253
|
+
'unicorn/no-negated-comparison'?: Linter.RuleEntry<UnicornNoNegatedComparison>;
|
|
8038
8254
|
/**
|
|
8039
8255
|
* Disallow negated conditions.
|
|
8040
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-condition.md
|
|
8041
8257
|
*/
|
|
8042
8258
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
8043
8259
|
/**
|
|
8044
8260
|
* Disallow negated expression in equality check.
|
|
8045
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negation-in-equality-check.md
|
|
8046
8262
|
*/
|
|
8047
8263
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
8048
8264
|
/**
|
|
8049
8265
|
* Disallow nested ternary expressions.
|
|
8050
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8266
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-nested-ternary.md
|
|
8051
8267
|
*/
|
|
8052
8268
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
8053
8269
|
/**
|
|
8054
8270
|
* Disallow `new Array()`.
|
|
8055
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-new-array.md
|
|
8056
8272
|
*/
|
|
8057
8273
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
8058
8274
|
/**
|
|
8059
8275
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
8060
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8276
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-new-buffer.md
|
|
8061
8277
|
*/
|
|
8062
8278
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
8279
|
+
/**
|
|
8280
|
+
* Disallow non-function values with function-style verb prefixes.
|
|
8281
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-non-function-verb-prefix.md
|
|
8282
|
+
*/
|
|
8283
|
+
'unicorn/no-non-function-verb-prefix'?: Linter.RuleEntry<UnicornNoNonFunctionVerbPrefix>;
|
|
8284
|
+
/**
|
|
8285
|
+
* Disallow non-standard properties on built-in objects.
|
|
8286
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-nonstandard-builtin-properties.md
|
|
8287
|
+
*/
|
|
8288
|
+
'unicorn/no-nonstandard-builtin-properties'?: Linter.RuleEntry<[]>;
|
|
8063
8289
|
/**
|
|
8064
8290
|
* Disallow the use of the `null` literal.
|
|
8065
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8291
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-null.md
|
|
8066
8292
|
*/
|
|
8067
8293
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
8068
8294
|
/**
|
|
8069
8295
|
* Disallow the use of objects as default parameters.
|
|
8070
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-object-as-default-parameter.md
|
|
8071
8297
|
*/
|
|
8072
8298
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
8299
|
+
/**
|
|
8300
|
+
* Disallow `Object` methods with `Map` or `Set`.
|
|
8301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-object-methods-with-collections.md
|
|
8302
|
+
*/
|
|
8303
|
+
'unicorn/no-object-methods-with-collections'?: Linter.RuleEntry<[]>;
|
|
8304
|
+
/**
|
|
8305
|
+
* Disallow optional chaining on undeclared variables.
|
|
8306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-optional-chaining-on-undeclared-variable.md
|
|
8307
|
+
*/
|
|
8308
|
+
'unicorn/no-optional-chaining-on-undeclared-variable'?: Linter.RuleEntry<[]>;
|
|
8073
8309
|
/**
|
|
8074
8310
|
* Disallow `process.exit()`.
|
|
8075
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-process-exit.md
|
|
8076
8312
|
*/
|
|
8077
8313
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
8314
|
+
/**
|
|
8315
|
+
* Disallow comparisons made redundant by an equality check in the same logical AND.
|
|
8316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-redundant-comparison.md
|
|
8317
|
+
*/
|
|
8318
|
+
'unicorn/no-redundant-comparison'?: Linter.RuleEntry<[]>;
|
|
8319
|
+
/**
|
|
8320
|
+
* Disallow using the return value of `Array#push()` and `Array#unshift()`.
|
|
8321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-return-array-push.md
|
|
8322
|
+
*/
|
|
8323
|
+
'unicorn/no-return-array-push'?: Linter.RuleEntry<[]>;
|
|
8324
|
+
/**
|
|
8325
|
+
* Disallow selector syntax in DOM names.
|
|
8326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-selector-as-dom-name.md
|
|
8327
|
+
*/
|
|
8328
|
+
'unicorn/no-selector-as-dom-name'?: Linter.RuleEntry<[]>;
|
|
8078
8329
|
/**
|
|
8079
8330
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
8080
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
8081
8332
|
*/
|
|
8082
8333
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
8083
8334
|
/**
|
|
8084
8335
|
* Disallow classes that only have static members.
|
|
8085
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-static-only-class.md
|
|
8086
8337
|
*/
|
|
8087
8338
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
8339
|
+
/**
|
|
8340
|
+
* Prefer comparing values directly over subtracting and comparing to `0`.
|
|
8341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-subtraction-comparison.md
|
|
8342
|
+
*/
|
|
8343
|
+
'unicorn/no-subtraction-comparison'?: Linter.RuleEntry<[]>;
|
|
8088
8344
|
/**
|
|
8089
8345
|
* Disallow `then` property.
|
|
8090
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-thenable.md
|
|
8091
8347
|
*/
|
|
8092
8348
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
8093
8349
|
/**
|
|
8094
8350
|
* Disallow assigning `this` to a variable.
|
|
8095
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-this-assignment.md
|
|
8096
8352
|
*/
|
|
8097
8353
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
8098
8354
|
/**
|
|
8099
8355
|
* Disallow `this` outside of classes.
|
|
8100
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-this-outside-of-class.md
|
|
8101
8357
|
*/
|
|
8102
8358
|
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
8359
|
+
/**
|
|
8360
|
+
* Disallow assigning to top-level variables from inside functions.
|
|
8361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-top-level-assignment-in-function.md
|
|
8362
|
+
*/
|
|
8363
|
+
'unicorn/no-top-level-assignment-in-function'?: Linter.RuleEntry<[]>;
|
|
8364
|
+
/**
|
|
8365
|
+
* Disallow top-level side effects in exported modules.
|
|
8366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-top-level-side-effects.md
|
|
8367
|
+
*/
|
|
8368
|
+
'unicorn/no-top-level-side-effects'?: Linter.RuleEntry<[]>;
|
|
8103
8369
|
/**
|
|
8104
8370
|
* Disallow comparing `undefined` using `typeof`.
|
|
8105
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-typeof-undefined.md
|
|
8106
8372
|
*/
|
|
8107
8373
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
8374
|
+
/**
|
|
8375
|
+
* Disallow referencing methods without calling them.
|
|
8376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-uncalled-method.md
|
|
8377
|
+
*/
|
|
8378
|
+
'unicorn/no-uncalled-method'?: Linter.RuleEntry<[]>;
|
|
8379
|
+
/**
|
|
8380
|
+
* Require class members to be declared.
|
|
8381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-undeclared-class-members.md
|
|
8382
|
+
*/
|
|
8383
|
+
'unicorn/no-undeclared-class-members'?: Linter.RuleEntry<[]>;
|
|
8108
8384
|
/**
|
|
8109
8385
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
8110
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8386
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
8111
8387
|
*/
|
|
8112
8388
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
8113
8389
|
/**
|
|
8114
8390
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
8115
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8391
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
8116
8392
|
*/
|
|
8117
8393
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
8118
8394
|
/**
|
|
8119
8395
|
* Disallow awaiting non-promise values.
|
|
8120
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8396
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-await.md
|
|
8121
8397
|
*/
|
|
8122
8398
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
8399
|
+
/**
|
|
8400
|
+
* Disallow unnecessary comparisons against boolean literals.
|
|
8401
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-boolean-comparison.md
|
|
8402
|
+
*/
|
|
8403
|
+
'unicorn/no-unnecessary-boolean-comparison'?: Linter.RuleEntry<[]>;
|
|
8404
|
+
/**
|
|
8405
|
+
* Disallow unnecessary `globalThis` references.
|
|
8406
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-global-this.md
|
|
8407
|
+
*/
|
|
8408
|
+
'unicorn/no-unnecessary-global-this'?: Linter.RuleEntry<[]>;
|
|
8123
8409
|
/**
|
|
8124
8410
|
* Disallow unnecessary nested ternary expressions.
|
|
8125
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8411
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-nested-ternary.md
|
|
8126
8412
|
*/
|
|
8127
8413
|
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
8128
8414
|
/**
|
|
8129
8415
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
8130
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8416
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
8131
8417
|
*/
|
|
8132
8418
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
8133
8419
|
/**
|
|
8134
8420
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
8135
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8421
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
8136
8422
|
*/
|
|
8137
8423
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
8424
|
+
/**
|
|
8425
|
+
* Disallow `Array#splice()` when simpler alternatives exist.
|
|
8426
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-splice.md
|
|
8427
|
+
*/
|
|
8428
|
+
'unicorn/no-unnecessary-splice'?: Linter.RuleEntry<[]>;
|
|
8138
8429
|
/**
|
|
8139
8430
|
* Disallow unreadable array destructuring.
|
|
8140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8431
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
8141
8432
|
*/
|
|
8142
|
-
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<
|
|
8433
|
+
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<UnicornNoUnreadableArrayDestructuring>;
|
|
8434
|
+
/**
|
|
8435
|
+
* Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
|
|
8436
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-for-of-expression.md
|
|
8437
|
+
*/
|
|
8438
|
+
'unicorn/no-unreadable-for-of-expression'?: Linter.RuleEntry<[]>;
|
|
8143
8439
|
/**
|
|
8144
8440
|
* Disallow unreadable IIFEs.
|
|
8145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8441
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-iife.md
|
|
8146
8442
|
*/
|
|
8147
8443
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
8444
|
+
/**
|
|
8445
|
+
* Disallow unreadable `new` expressions.
|
|
8446
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-new-expression.md
|
|
8447
|
+
*/
|
|
8448
|
+
'unicorn/no-unreadable-new-expression'?: Linter.RuleEntry<[]>;
|
|
8449
|
+
/**
|
|
8450
|
+
* Disallow unreadable object destructuring.
|
|
8451
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-object-destructuring.md
|
|
8452
|
+
*/
|
|
8453
|
+
'unicorn/no-unreadable-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
8454
|
+
/**
|
|
8455
|
+
* Prevent unsafe use of ArrayBuffer view `.buffer`.
|
|
8456
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-buffer-conversion.md
|
|
8457
|
+
*/
|
|
8458
|
+
'unicorn/no-unsafe-buffer-conversion'?: Linter.RuleEntry<[]>;
|
|
8459
|
+
/**
|
|
8460
|
+
* Disallow unsafe DOM HTML APIs.
|
|
8461
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-dom-html.md
|
|
8462
|
+
*/
|
|
8463
|
+
'unicorn/no-unsafe-dom-html'?: Linter.RuleEntry<[]>;
|
|
8464
|
+
/**
|
|
8465
|
+
* Disallow unsafe values as property keys.
|
|
8466
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-property-key.md
|
|
8467
|
+
*/
|
|
8468
|
+
'unicorn/no-unsafe-property-key'?: Linter.RuleEntry<[]>;
|
|
8469
|
+
/**
|
|
8470
|
+
* Disallow non-literal replacement values in `String#replace()` and `String#replaceAll()`.
|
|
8471
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-string-replacement.md
|
|
8472
|
+
*/
|
|
8473
|
+
'unicorn/no-unsafe-string-replacement'?: Linter.RuleEntry<[]>;
|
|
8148
8474
|
/**
|
|
8149
8475
|
* Disallow ignoring the return value of selected array methods.
|
|
8150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8476
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unused-array-method-return.md
|
|
8151
8477
|
*/
|
|
8152
8478
|
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
8153
8479
|
/**
|
|
8154
8480
|
* Disallow unused object properties.
|
|
8155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8481
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unused-properties.md
|
|
8156
8482
|
*/
|
|
8157
8483
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
8484
|
+
/**
|
|
8485
|
+
* Disallow unnecessary `Boolean()` casts in array predicate callbacks.
|
|
8486
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-boolean-cast.md
|
|
8487
|
+
*/
|
|
8488
|
+
'unicorn/no-useless-boolean-cast'?: Linter.RuleEntry<[]>;
|
|
8489
|
+
/**
|
|
8490
|
+
* Disallow useless type coercions of values that are already of the target type.
|
|
8491
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-coercion.md
|
|
8492
|
+
*/
|
|
8493
|
+
'unicorn/no-useless-coercion'?: Linter.RuleEntry<[]>;
|
|
8158
8494
|
/**
|
|
8159
8495
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
8160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8496
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-collection-argument.md
|
|
8161
8497
|
*/
|
|
8162
8498
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
8499
|
+
/**
|
|
8500
|
+
* Disallow useless compound assignments such as `x += 0`.
|
|
8501
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-compound-assignment.md
|
|
8502
|
+
*/
|
|
8503
|
+
'unicorn/no-useless-compound-assignment'?: Linter.RuleEntry<[]>;
|
|
8504
|
+
/**
|
|
8505
|
+
* Disallow useless concatenation of literals.
|
|
8506
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-concat.md
|
|
8507
|
+
*/
|
|
8508
|
+
'unicorn/no-useless-concat'?: Linter.RuleEntry<[]>;
|
|
8509
|
+
/**
|
|
8510
|
+
* Disallow useless `continue` statements.
|
|
8511
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-continue.md
|
|
8512
|
+
*/
|
|
8513
|
+
'unicorn/no-useless-continue'?: Linter.RuleEntry<[]>;
|
|
8514
|
+
/**
|
|
8515
|
+
* Disallow unnecessary existence checks before deletion.
|
|
8516
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-delete-check.md
|
|
8517
|
+
*/
|
|
8518
|
+
'unicorn/no-useless-delete-check'?: Linter.RuleEntry<[]>;
|
|
8519
|
+
/**
|
|
8520
|
+
* Disallow `else` after a statement that exits.
|
|
8521
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-else.md
|
|
8522
|
+
*/
|
|
8523
|
+
'unicorn/no-useless-else'?: Linter.RuleEntry<[]>;
|
|
8163
8524
|
/**
|
|
8164
8525
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
8165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8526
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
8166
8527
|
*/
|
|
8167
8528
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
8168
8529
|
/**
|
|
8169
8530
|
* Disallow useless fallback when spreading in object literals.
|
|
8170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8531
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
8171
8532
|
*/
|
|
8172
8533
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
8173
8534
|
/**
|
|
8174
8535
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
8175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8536
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
8176
8537
|
*/
|
|
8177
8538
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
8178
8539
|
/**
|
|
8179
8540
|
* Disallow useless array length check.
|
|
8180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8541
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-length-check.md
|
|
8181
8542
|
*/
|
|
8182
8543
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
8544
|
+
/**
|
|
8545
|
+
* Disallow unnecessary operands in logical expressions involving boolean literals.
|
|
8546
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-logical-operand.md
|
|
8547
|
+
*/
|
|
8548
|
+
'unicorn/no-useless-logical-operand'?: Linter.RuleEntry<[]>;
|
|
8549
|
+
/**
|
|
8550
|
+
* Disallow useless overrides of class methods.
|
|
8551
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-override.md
|
|
8552
|
+
*/
|
|
8553
|
+
'unicorn/no-useless-override'?: Linter.RuleEntry<[]>;
|
|
8183
8554
|
/**
|
|
8184
8555
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
8185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8556
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
8186
8557
|
*/
|
|
8187
8558
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
8559
|
+
/**
|
|
8560
|
+
* Disallow simple recursive function calls that can be replaced with a loop.
|
|
8561
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-recursion.md
|
|
8562
|
+
*/
|
|
8563
|
+
'unicorn/no-useless-recursion'?: Linter.RuleEntry<[]>;
|
|
8188
8564
|
/**
|
|
8189
8565
|
* Disallow unnecessary spread.
|
|
8190
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8566
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-spread.md
|
|
8191
8567
|
*/
|
|
8192
8568
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
8193
8569
|
/**
|
|
8194
8570
|
* Disallow useless case in switch statements.
|
|
8195
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8571
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-switch-case.md
|
|
8196
8572
|
*/
|
|
8197
8573
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
8574
|
+
/**
|
|
8575
|
+
* Disallow useless template literal expressions.
|
|
8576
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-template-literals.md
|
|
8577
|
+
*/
|
|
8578
|
+
'unicorn/no-useless-template-literals'?: Linter.RuleEntry<[]>;
|
|
8198
8579
|
/**
|
|
8199
8580
|
* Disallow useless `undefined`.
|
|
8200
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8581
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-undefined.md
|
|
8201
8582
|
*/
|
|
8202
8583
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
8584
|
+
/**
|
|
8585
|
+
* Disallow the bitwise XOR operator where exponentiation was likely intended.
|
|
8586
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-xor-as-exponentiation.md
|
|
8587
|
+
*/
|
|
8588
|
+
'unicorn/no-xor-as-exponentiation'?: Linter.RuleEntry<[]>;
|
|
8203
8589
|
/**
|
|
8204
8590
|
* Disallow number literals with zero fractions or dangling dots.
|
|
8205
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8591
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-zero-fractions.md
|
|
8206
8592
|
*/
|
|
8207
8593
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
8208
8594
|
/**
|
|
8209
8595
|
* Enforce proper case for numeric literals.
|
|
8210
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8596
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/number-literal-case.md
|
|
8211
8597
|
*/
|
|
8212
8598
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
8213
8599
|
/**
|
|
8214
8600
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
8215
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8601
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/numeric-separators-style.md
|
|
8216
8602
|
*/
|
|
8217
8603
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
8604
|
+
/**
|
|
8605
|
+
* Require assignment operator shorthand where possible.
|
|
8606
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/operator-assignment.md
|
|
8607
|
+
*/
|
|
8608
|
+
'unicorn/operator-assignment'?: Linter.RuleEntry<UnicornOperatorAssignment>;
|
|
8218
8609
|
/**
|
|
8219
8610
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
8220
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8611
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-add-event-listener.md
|
|
8221
8612
|
*/
|
|
8222
8613
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
8614
|
+
/**
|
|
8615
|
+
* Prefer an options object over a boolean in `.addEventListener()`.
|
|
8616
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-add-event-listener-options.md
|
|
8617
|
+
*/
|
|
8618
|
+
'unicorn/prefer-add-event-listener-options'?: Linter.RuleEntry<[]>;
|
|
8223
8619
|
/**
|
|
8224
8620
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
8225
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8621
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-find.md
|
|
8226
8622
|
*/
|
|
8227
8623
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
8228
8624
|
/**
|
|
8229
8625
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
8230
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8626
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-flat.md
|
|
8231
8627
|
*/
|
|
8232
8628
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
8233
8629
|
/**
|
|
8234
|
-
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
8235
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8630
|
+
* Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.
|
|
8631
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-flat-map.md
|
|
8236
8632
|
*/
|
|
8237
8633
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
8634
|
+
/**
|
|
8635
|
+
* Prefer `Array.fromAsync()` over `for await…of` array accumulation.
|
|
8636
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-from-async.md
|
|
8637
|
+
*/
|
|
8638
|
+
'unicorn/prefer-array-from-async'?: Linter.RuleEntry<[]>;
|
|
8639
|
+
/**
|
|
8640
|
+
* Prefer using the `Array.from()` mapping function argument.
|
|
8641
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-from-map.md
|
|
8642
|
+
*/
|
|
8643
|
+
'unicorn/prefer-array-from-map'?: Linter.RuleEntry<[]>;
|
|
8238
8644
|
/**
|
|
8239
8645
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
8240
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8646
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-index-of.md
|
|
8241
8647
|
*/
|
|
8242
8648
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
8649
|
+
/**
|
|
8650
|
+
* Prefer iterating an array directly or with `Array#keys()` over `Array#entries()` when the index or value is unused.
|
|
8651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-iterable-methods.md
|
|
8652
|
+
*/
|
|
8653
|
+
'unicorn/prefer-array-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
8243
8654
|
/**
|
|
8244
8655
|
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
8245
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-last-methods.md
|
|
8246
8657
|
*/
|
|
8247
8658
|
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
8659
|
+
/**
|
|
8660
|
+
* Prefer `Array#slice()` over `Array#splice()` when reading from the returned array.
|
|
8661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-slice.md
|
|
8662
|
+
*/
|
|
8663
|
+
'unicorn/prefer-array-slice'?: Linter.RuleEntry<[]>;
|
|
8248
8664
|
/**
|
|
8249
8665
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
8250
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-some.md
|
|
8251
8667
|
*/
|
|
8252
8668
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
8253
8669
|
/**
|
|
8254
8670
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
8255
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-at.md
|
|
8256
8672
|
*/
|
|
8257
8673
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
8674
|
+
/**
|
|
8675
|
+
* Prefer `await` over promise chaining.
|
|
8676
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-await.md
|
|
8677
|
+
*/
|
|
8678
|
+
'unicorn/prefer-await'?: Linter.RuleEntry<[]>;
|
|
8258
8679
|
/**
|
|
8259
8680
|
* Prefer `BigInt` literals over the constructor.
|
|
8260
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8681
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-bigint-literals.md
|
|
8261
8682
|
*/
|
|
8262
8683
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
8263
8684
|
/**
|
|
8264
8685
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
8265
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8686
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
8266
8687
|
*/
|
|
8267
8688
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
8689
|
+
/**
|
|
8690
|
+
* Prefer directly returning boolean expressions over `if` statements.
|
|
8691
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-boolean-return.md
|
|
8692
|
+
*/
|
|
8693
|
+
'unicorn/prefer-boolean-return'?: Linter.RuleEntry<[]>;
|
|
8268
8694
|
/**
|
|
8269
8695
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
8270
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8696
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-class-fields.md
|
|
8271
8697
|
*/
|
|
8272
8698
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
8273
8699
|
/**
|
|
8274
8700
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
8275
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8701
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-classlist-toggle.md
|
|
8276
8702
|
*/
|
|
8277
8703
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
8278
8704
|
/**
|
|
8279
8705
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
8280
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8706
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-code-point.md
|
|
8281
8707
|
*/
|
|
8282
8708
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
8709
|
+
/**
|
|
8710
|
+
* Prefer early continues over whole-loop conditional wrapping.
|
|
8711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-continue.md
|
|
8712
|
+
*/
|
|
8713
|
+
'unicorn/prefer-continue'?: Linter.RuleEntry<UnicornPreferContinue>;
|
|
8283
8714
|
/**
|
|
8284
8715
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
8285
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-date-now.md
|
|
8286
8717
|
*/
|
|
8287
8718
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
8288
8719
|
/**
|
|
8289
8720
|
* Prefer default parameters over reassignment.
|
|
8290
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-default-parameters.md
|
|
8291
8722
|
*/
|
|
8292
8723
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
8724
|
+
/**
|
|
8725
|
+
* Prefer direct iteration over default iterator method calls.
|
|
8726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-direct-iteration.md
|
|
8727
|
+
*/
|
|
8728
|
+
'unicorn/prefer-direct-iteration'?: Linter.RuleEntry<[]>;
|
|
8729
|
+
/**
|
|
8730
|
+
* Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
|
|
8731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dispose.md
|
|
8732
|
+
*/
|
|
8733
|
+
'unicorn/prefer-dispose'?: Linter.RuleEntry<[]>;
|
|
8293
8734
|
/**
|
|
8294
8735
|
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
8295
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-append.md
|
|
8296
8737
|
*/
|
|
8297
8738
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
8298
8739
|
/**
|
|
8299
8740
|
* Renamed to `unicorn/dom-node-dataset`.
|
|
8300
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
8301
8742
|
* @deprecated
|
|
8302
8743
|
*/
|
|
8303
8744
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
8745
|
+
/**
|
|
8746
|
+
* Prefer `.getHTML()` and `.setHTML()` over `.innerHTML`.
|
|
8747
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-html-methods.md
|
|
8748
|
+
*/
|
|
8749
|
+
'unicorn/prefer-dom-node-html-methods'?: Linter.RuleEntry<[]>;
|
|
8304
8750
|
/**
|
|
8305
8751
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
8306
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8752
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-remove.md
|
|
8307
8753
|
*/
|
|
8308
8754
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
8309
8755
|
/**
|
|
8310
8756
|
* Prefer `.textContent` over `.innerText`.
|
|
8311
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8757
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
8312
8758
|
*/
|
|
8313
8759
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
8760
|
+
/**
|
|
8761
|
+
* Prefer early returns over full-function conditional wrapping.
|
|
8762
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-early-return.md
|
|
8763
|
+
*/
|
|
8764
|
+
'unicorn/prefer-early-return'?: Linter.RuleEntry<UnicornPreferEarlyReturn>;
|
|
8765
|
+
/**
|
|
8766
|
+
* Prefer `else if` over adjacent `if` statements with related conditions.
|
|
8767
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-else-if.md
|
|
8768
|
+
*/
|
|
8769
|
+
'unicorn/prefer-else-if'?: Linter.RuleEntry<[]>;
|
|
8314
8770
|
/**
|
|
8315
8771
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
8316
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8772
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-event-target.md
|
|
8317
8773
|
*/
|
|
8318
8774
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
8319
8775
|
/**
|
|
8320
8776
|
* Prefer `export…from` when re-exporting.
|
|
8321
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8777
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-export-from.md
|
|
8322
8778
|
*/
|
|
8323
8779
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
8780
|
+
/**
|
|
8781
|
+
* Prefer flat `Math.min()` and `Math.max()` calls over nested calls.
|
|
8782
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-flat-math-min-max.md
|
|
8783
|
+
*/
|
|
8784
|
+
'unicorn/prefer-flat-math-min-max'?: Linter.RuleEntry<[]>;
|
|
8324
8785
|
/**
|
|
8325
8786
|
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
8326
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8787
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-get-or-insert-computed.md
|
|
8327
8788
|
*/
|
|
8328
8789
|
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
8790
|
+
/**
|
|
8791
|
+
* Prefer global numeric constants over `Number` static properties.
|
|
8792
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-global-number-constants.md
|
|
8793
|
+
*/
|
|
8794
|
+
'unicorn/prefer-global-number-constants'?: Linter.RuleEntry<[]>;
|
|
8329
8795
|
/**
|
|
8330
8796
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
8331
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8797
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-global-this.md
|
|
8332
8798
|
*/
|
|
8333
8799
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
8800
|
+
/**
|
|
8801
|
+
* Prefer `.has()` when checking existence.
|
|
8802
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-has-check.md
|
|
8803
|
+
*/
|
|
8804
|
+
'unicorn/prefer-has-check'?: Linter.RuleEntry<[]>;
|
|
8805
|
+
/**
|
|
8806
|
+
* Prefer moving code shared by all branches of an `if` statement out of the branches.
|
|
8807
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-hoisting-branch-code.md
|
|
8808
|
+
*/
|
|
8809
|
+
'unicorn/prefer-hoisting-branch-code'?: Linter.RuleEntry<[]>;
|
|
8334
8810
|
/**
|
|
8335
8811
|
* Prefer HTTPS over HTTP.
|
|
8336
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8812
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-https.md
|
|
8337
8813
|
*/
|
|
8338
8814
|
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
8815
|
+
/**
|
|
8816
|
+
* Prefer identifiers over string literals in import and export specifiers.
|
|
8817
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-identifier-import-export-specifiers.md
|
|
8818
|
+
*/
|
|
8819
|
+
'unicorn/prefer-identifier-import-export-specifiers'?: Linter.RuleEntry<[]>;
|
|
8339
8820
|
/**
|
|
8340
8821
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
8341
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8822
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-import-meta-properties.md
|
|
8342
8823
|
*/
|
|
8343
8824
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
8344
8825
|
/**
|
|
8345
8826
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
8346
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8827
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-includes.md
|
|
8347
8828
|
*/
|
|
8348
8829
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
8349
8830
|
/**
|
|
8350
8831
|
* Prefer `.includes()` over repeated equality comparisons.
|
|
8351
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8832
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
8352
8833
|
*/
|
|
8353
8834
|
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
8835
|
+
/**
|
|
8836
|
+
* Prefer passing iterables directly to constructors instead of filling empty collections.
|
|
8837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterable-in-constructor.md
|
|
8838
|
+
*/
|
|
8839
|
+
'unicorn/prefer-iterable-in-constructor'?: Linter.RuleEntry<[]>;
|
|
8354
8840
|
/**
|
|
8355
8841
|
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
8356
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-concat.md
|
|
8357
8843
|
*/
|
|
8358
8844
|
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
8845
|
+
/**
|
|
8846
|
+
* Prefer `Iterator#toArray()` over temporary arrays from iterator spreads.
|
|
8847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-to-array.md
|
|
8848
|
+
*/
|
|
8849
|
+
'unicorn/prefer-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
8359
8850
|
/**
|
|
8360
8851
|
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
8361
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-to-array-at-end.md
|
|
8362
8853
|
*/
|
|
8363
8854
|
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
8364
8855
|
/**
|
|
8365
8856
|
* Renamed to `unicorn/consistent-json-file-read`.
|
|
8366
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
8367
8858
|
* @deprecated
|
|
8368
8859
|
*/
|
|
8369
8860
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
8370
8861
|
/**
|
|
8371
8862
|
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
8372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8863
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
8373
8864
|
*/
|
|
8374
8865
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
8866
|
+
/**
|
|
8867
|
+
* Prefer `location.assign()` over assigning to `location.href`.
|
|
8868
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-location-assign.md
|
|
8869
|
+
*/
|
|
8870
|
+
'unicorn/prefer-location-assign'?: Linter.RuleEntry<[]>;
|
|
8375
8871
|
/**
|
|
8376
8872
|
* Prefer using a logical operator over a ternary.
|
|
8377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8873
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
8378
8874
|
*/
|
|
8379
8875
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
8876
|
+
/**
|
|
8877
|
+
* Prefer `new Map()` over `Object.fromEntries()` when using the result as a map.
|
|
8878
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-map-from-entries.md
|
|
8879
|
+
*/
|
|
8880
|
+
'unicorn/prefer-map-from-entries'?: Linter.RuleEntry<[]>;
|
|
8380
8881
|
/**
|
|
8381
8882
|
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
8382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8883
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-abs.md
|
|
8383
8884
|
*/
|
|
8384
8885
|
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
8886
|
+
/**
|
|
8887
|
+
* Prefer `Math` constants over their approximate numeric values.
|
|
8888
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-constants.md
|
|
8889
|
+
*/
|
|
8890
|
+
'unicorn/prefer-math-constants'?: Linter.RuleEntry<[]>;
|
|
8385
8891
|
/**
|
|
8386
8892
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
8387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8893
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-min-max.md
|
|
8388
8894
|
*/
|
|
8389
8895
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
8390
8896
|
/**
|
|
8391
|
-
*
|
|
8392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8897
|
+
* Prefer `Math.trunc()` for truncating numbers.
|
|
8898
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-trunc.md
|
|
8393
8899
|
*/
|
|
8394
8900
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
8395
8901
|
/**
|
|
8396
|
-
* Prefer
|
|
8397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8902
|
+
* Prefer moving ternaries into the minimal varying part of an expression.
|
|
8903
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-minimal-ternary.md
|
|
8904
|
+
*/
|
|
8905
|
+
'unicorn/prefer-minimal-ternary'?: Linter.RuleEntry<UnicornPreferMinimalTernary>;
|
|
8906
|
+
/**
|
|
8907
|
+
* Prefer modern DOM APIs.
|
|
8908
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
8398
8909
|
*/
|
|
8399
8910
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
8400
8911
|
/**
|
|
8401
8912
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
8402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8913
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-modern-math-apis.md
|
|
8403
8914
|
*/
|
|
8404
8915
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
8405
8916
|
/**
|
|
8406
8917
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
8407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8918
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-module.md
|
|
8408
8919
|
*/
|
|
8409
8920
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
8410
8921
|
/**
|
|
8411
8922
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
8412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8923
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
8413
8924
|
*/
|
|
8414
8925
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
8415
8926
|
/**
|
|
8416
8927
|
* Prefer negative index over `.length - index` when possible.
|
|
8417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8928
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-negative-index.md
|
|
8418
8929
|
*/
|
|
8419
8930
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
8420
8931
|
/**
|
|
8421
8932
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
8422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8933
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-node-protocol.md
|
|
8423
8934
|
*/
|
|
8424
8935
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
8425
8936
|
/**
|
|
8426
|
-
* Prefer `Number`
|
|
8427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8937
|
+
* Prefer `Number()` over `parseFloat()` and base-10 `parseInt()`.
|
|
8938
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-coercion.md
|
|
8939
|
+
*/
|
|
8940
|
+
'unicorn/prefer-number-coercion'?: Linter.RuleEntry<[]>;
|
|
8941
|
+
/**
|
|
8942
|
+
* Prefer `Number.isSafeInteger()` over integer checks.
|
|
8943
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-is-safe-integer.md
|
|
8944
|
+
*/
|
|
8945
|
+
'unicorn/prefer-number-is-safe-integer'?: Linter.RuleEntry<[]>;
|
|
8946
|
+
/**
|
|
8947
|
+
* Prefer `Number` static methods over global functions and optionally static properties over global constants.
|
|
8948
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-properties.md
|
|
8428
8949
|
*/
|
|
8429
8950
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
8951
|
+
/**
|
|
8952
|
+
* Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.
|
|
8953
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-define-properties.md
|
|
8954
|
+
*/
|
|
8955
|
+
'unicorn/prefer-object-define-properties'?: Linter.RuleEntry<[]>;
|
|
8956
|
+
/**
|
|
8957
|
+
* Prefer object destructuring defaults over default object literals with spread.
|
|
8958
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-destructuring-defaults.md
|
|
8959
|
+
*/
|
|
8960
|
+
'unicorn/prefer-object-destructuring-defaults'?: Linter.RuleEntry<[]>;
|
|
8430
8961
|
/**
|
|
8431
8962
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
8432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8963
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-from-entries.md
|
|
8433
8964
|
*/
|
|
8434
8965
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
8966
|
+
/**
|
|
8967
|
+
* Prefer the most specific `Object` iterable method.
|
|
8968
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-iterable-methods.md
|
|
8969
|
+
*/
|
|
8970
|
+
'unicorn/prefer-object-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
8435
8971
|
/**
|
|
8436
8972
|
* Prefer omitting the `catch` binding parameter.
|
|
8437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8973
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
8438
8974
|
*/
|
|
8439
8975
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
8976
|
+
/**
|
|
8977
|
+
* Prefer `Path2D` for repeatedly drawn canvas paths.
|
|
8978
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-path2d.md
|
|
8979
|
+
*/
|
|
8980
|
+
'unicorn/prefer-path2d'?: Linter.RuleEntry<[]>;
|
|
8981
|
+
/**
|
|
8982
|
+
* Prefer private class fields over the underscore-prefix convention.
|
|
8983
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-private-class-fields.md
|
|
8984
|
+
*/
|
|
8985
|
+
'unicorn/prefer-private-class-fields'?: Linter.RuleEntry<[]>;
|
|
8986
|
+
/**
|
|
8987
|
+
* Prefer `Promise.withResolvers()` when extracting resolver functions from `new Promise()`.
|
|
8988
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-promise-with-resolvers.md
|
|
8989
|
+
*/
|
|
8990
|
+
'unicorn/prefer-promise-with-resolvers'?: Linter.RuleEntry<[]>;
|
|
8440
8991
|
/**
|
|
8441
8992
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
8442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8993
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-prototype-methods.md
|
|
8443
8994
|
*/
|
|
8444
8995
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
8445
8996
|
/**
|
|
8446
8997
|
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
8447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
8998
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-query-selector.md
|
|
8448
8999
|
*/
|
|
8449
9000
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
8450
9001
|
/**
|
|
8451
9002
|
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
8452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9003
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-queue-microtask.md
|
|
8453
9004
|
*/
|
|
8454
9005
|
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
8455
9006
|
/**
|
|
8456
9007
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
8457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9008
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-reflect-apply.md
|
|
8458
9009
|
*/
|
|
8459
9010
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
8460
9011
|
/**
|
|
8461
|
-
* Prefer `RegExp
|
|
8462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9012
|
+
* Prefer `RegExp.escape()` for escaping strings to use in regular expressions.
|
|
9013
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-regexp-escape.md
|
|
9014
|
+
*/
|
|
9015
|
+
'unicorn/prefer-regexp-escape'?: Linter.RuleEntry<[]>;
|
|
9016
|
+
/**
|
|
9017
|
+
* Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.
|
|
9018
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-regexp-test.md
|
|
8463
9019
|
*/
|
|
8464
9020
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
8465
9021
|
/**
|
|
8466
9022
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
8467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9023
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-response-static-json.md
|
|
8468
9024
|
*/
|
|
8469
9025
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
9026
|
+
/**
|
|
9027
|
+
* Prefer `:scope` when using element query selector methods.
|
|
9028
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-scoped-selector.md
|
|
9029
|
+
*/
|
|
9030
|
+
'unicorn/prefer-scoped-selector'?: Linter.RuleEntry<[]>;
|
|
8470
9031
|
/**
|
|
8471
9032
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
8472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9033
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-set-has.md
|
|
8473
9034
|
*/
|
|
8474
9035
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
8475
9036
|
/**
|
|
8476
9037
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
8477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9038
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-set-size.md
|
|
8478
9039
|
*/
|
|
8479
9040
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
9041
|
+
/**
|
|
9042
|
+
* Prefer arrow function properties over methods with a single return.
|
|
9043
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-short-arrow-method.md
|
|
9044
|
+
*/
|
|
9045
|
+
'unicorn/prefer-short-arrow-method'?: Linter.RuleEntry<[]>;
|
|
8480
9046
|
/**
|
|
8481
9047
|
* Prefer simple conditions first in logical expressions.
|
|
8482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9048
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-simple-condition-first.md
|
|
8483
9049
|
*/
|
|
8484
9050
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
9051
|
+
/**
|
|
9052
|
+
* Prefer a simple comparison function for `Array#sort()`.
|
|
9053
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-simple-sort-comparator.md
|
|
9054
|
+
*/
|
|
9055
|
+
'unicorn/prefer-simple-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
9056
|
+
/**
|
|
9057
|
+
* Prefer a single `Array#some()` or `Array#every()` with a combined predicate.
|
|
9058
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-array-predicate.md
|
|
9059
|
+
*/
|
|
9060
|
+
'unicorn/prefer-single-array-predicate'?: Linter.RuleEntry<[]>;
|
|
8485
9061
|
/**
|
|
8486
9062
|
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
8487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9063
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-call.md
|
|
8488
9064
|
*/
|
|
8489
9065
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
9066
|
+
/**
|
|
9067
|
+
* Prefer a single object destructuring declaration per local const source.
|
|
9068
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-object-destructuring.md
|
|
9069
|
+
*/
|
|
9070
|
+
'unicorn/prefer-single-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
9071
|
+
/**
|
|
9072
|
+
* Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.
|
|
9073
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-replace.md
|
|
9074
|
+
*/
|
|
9075
|
+
'unicorn/prefer-single-replace'?: Linter.RuleEntry<[]>;
|
|
9076
|
+
/**
|
|
9077
|
+
* Prefer declaring variables in the smallest possible scope.
|
|
9078
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-smaller-scope.md
|
|
9079
|
+
*/
|
|
9080
|
+
'unicorn/prefer-smaller-scope'?: Linter.RuleEntry<[]>;
|
|
8490
9081
|
/**
|
|
8491
9082
|
* Prefer `String#split()` with a limit.
|
|
8492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9083
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-split-limit.md
|
|
8493
9084
|
*/
|
|
8494
9085
|
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
8495
9086
|
/**
|
|
8496
|
-
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()
|
|
8497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9087
|
+
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()`, and trivial `for…of` copies.
|
|
9088
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-spread.md
|
|
8498
9089
|
*/
|
|
8499
9090
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
8500
9091
|
/**
|
|
8501
9092
|
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
8502
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9093
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-match-all.md
|
|
8503
9094
|
*/
|
|
8504
9095
|
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
8505
9096
|
/**
|
|
8506
9097
|
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
8507
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-pad-start-end.md
|
|
8508
9099
|
*/
|
|
8509
9100
|
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
8510
9101
|
/**
|
|
8511
9102
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
8512
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-raw.md
|
|
8513
9104
|
*/
|
|
8514
9105
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
8515
9106
|
/**
|
|
8516
9107
|
* Prefer `String#repeat()` for repeated whitespace.
|
|
8517
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-repeat.md
|
|
8518
9109
|
*/
|
|
8519
9110
|
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
8520
9111
|
/**
|
|
8521
9112
|
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
8522
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-replace-all.md
|
|
8523
9114
|
*/
|
|
8524
9115
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
8525
9116
|
/**
|
|
8526
9117
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
8527
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-slice.md
|
|
8528
9119
|
*/
|
|
8529
9120
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
8530
9121
|
/**
|
|
8531
|
-
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
8532
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9122
|
+
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()` and `String#indexOf() === 0`.
|
|
9123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
8533
9124
|
*/
|
|
8534
9125
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
8535
9126
|
/**
|
|
8536
9127
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
8537
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
8538
9129
|
*/
|
|
8539
9130
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
8540
9131
|
/**
|
|
8541
9132
|
* Prefer using `structuredClone` to create a deep clone.
|
|
8542
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-structured-clone.md
|
|
8543
9134
|
*/
|
|
8544
9135
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
8545
9136
|
/**
|
|
8546
9137
|
* Prefer `switch` over multiple `else-if`.
|
|
8547
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-switch.md
|
|
8548
9139
|
*/
|
|
8549
9140
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
8550
9141
|
/**
|
|
8551
|
-
* Prefer
|
|
8552
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9142
|
+
* Prefer `Temporal` over `Date`.
|
|
9143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-temporal.md
|
|
9144
|
+
*/
|
|
9145
|
+
'unicorn/prefer-temporal'?: Linter.RuleEntry<UnicornPreferTemporal>;
|
|
9146
|
+
/**
|
|
9147
|
+
* Prefer ternary expressions over simple `if` statements that return or assign values.
|
|
9148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-ternary.md
|
|
8553
9149
|
*/
|
|
8554
9150
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
8555
9151
|
/**
|
|
8556
9152
|
* Prefer top-level await over top-level promises and async function calls.
|
|
8557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-top-level-await.md
|
|
8558
9154
|
*/
|
|
8559
9155
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
8560
9156
|
/**
|
|
8561
9157
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
8562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-type-error.md
|
|
8563
9159
|
*/
|
|
8564
9160
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
8565
9161
|
/**
|
|
8566
|
-
*
|
|
8567
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9162
|
+
* Require type literals to be last in union types.
|
|
9163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-type-literal-last.md
|
|
9164
|
+
*/
|
|
9165
|
+
'unicorn/prefer-type-literal-last'?: Linter.RuleEntry<[]>;
|
|
9166
|
+
/**
|
|
9167
|
+
* Prefer `Uint8Array#toBase64()` and `Uint8Array.fromBase64()` over `atob()`, `btoa()`, and `Buffer` base64 conversions.
|
|
9168
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-uint8array-base64.md
|
|
8568
9169
|
*/
|
|
8569
|
-
'unicorn/
|
|
9170
|
+
'unicorn/prefer-uint8array-base64'?: Linter.RuleEntry<[]>;
|
|
9171
|
+
/**
|
|
9172
|
+
* Prefer the unary minus operator over multiplying or dividing by `-1`.
|
|
9173
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-unary-minus.md
|
|
9174
|
+
*/
|
|
9175
|
+
'unicorn/prefer-unary-minus'?: Linter.RuleEntry<[]>;
|
|
9176
|
+
/**
|
|
9177
|
+
* Prefer Unicode code point escapes over legacy escape sequences.
|
|
9178
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-unicode-code-point-escapes.md
|
|
9179
|
+
*/
|
|
9180
|
+
'unicorn/prefer-unicode-code-point-escapes'?: Linter.RuleEntry<[]>;
|
|
9181
|
+
/**
|
|
9182
|
+
* Prefer `URL.canParse()` over constructing a `URL` in a try/catch for validation.
|
|
9183
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-url-can-parse.md
|
|
9184
|
+
*/
|
|
9185
|
+
'unicorn/prefer-url-can-parse'?: Linter.RuleEntry<[]>;
|
|
9186
|
+
/**
|
|
9187
|
+
* Prefer `URL#href` over stringifying a `URL`.
|
|
9188
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-url-href.md
|
|
9189
|
+
*/
|
|
9190
|
+
'unicorn/prefer-url-href'?: Linter.RuleEntry<[]>;
|
|
9191
|
+
/**
|
|
9192
|
+
* Prefer putting the condition in the while statement.
|
|
9193
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-while-loop-condition.md
|
|
9194
|
+
*/
|
|
9195
|
+
'unicorn/prefer-while-loop-condition'?: Linter.RuleEntry<[]>;
|
|
9196
|
+
/**
|
|
9197
|
+
* Renamed to `unicorn/name-replacements`.
|
|
9198
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prevent-abbreviations
|
|
9199
|
+
* @deprecated
|
|
9200
|
+
*/
|
|
9201
|
+
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<[]>;
|
|
8570
9202
|
/**
|
|
8571
9203
|
* Enforce consistent relative URL style.
|
|
8572
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9204
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/relative-url-style.md
|
|
8573
9205
|
*/
|
|
8574
9206
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
8575
9207
|
/**
|
|
8576
9208
|
* Enforce using the separator argument with `Array#join()`.
|
|
8577
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9209
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-array-join-separator.md
|
|
8578
9210
|
*/
|
|
8579
9211
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
9212
|
+
/**
|
|
9213
|
+
* Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
|
|
9214
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-array-sort-compare.md
|
|
9215
|
+
*/
|
|
9216
|
+
'unicorn/require-array-sort-compare'?: Linter.RuleEntry<[]>;
|
|
8580
9217
|
/**
|
|
8581
9218
|
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
8582
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9219
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-css-escape.md
|
|
8583
9220
|
*/
|
|
8584
9221
|
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
8585
9222
|
/**
|
|
8586
9223
|
* Require non-empty module attributes for imports and exports
|
|
8587
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9224
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-module-attributes.md
|
|
8588
9225
|
*/
|
|
8589
9226
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
8590
9227
|
/**
|
|
8591
9228
|
* Require non-empty specifier list in import and export statements.
|
|
8592
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9229
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-module-specifiers.md
|
|
8593
9230
|
*/
|
|
8594
9231
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
8595
9232
|
/**
|
|
8596
9233
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
8597
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9234
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
8598
9235
|
*/
|
|
8599
9236
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
8600
9237
|
/**
|
|
8601
9238
|
* Require passive event listeners for high-frequency events.
|
|
8602
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9239
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-passive-events.md
|
|
8603
9240
|
*/
|
|
8604
9241
|
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
8605
9242
|
/**
|
|
8606
9243
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
8607
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9244
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-post-message-target-origin.md
|
|
8608
9245
|
*/
|
|
8609
9246
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
9247
|
+
/**
|
|
9248
|
+
* Require boolean-returning Proxy traps to return booleans.
|
|
9249
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-proxy-trap-boolean-return.md
|
|
9250
|
+
*/
|
|
9251
|
+
'unicorn/require-proxy-trap-boolean-return'?: Linter.RuleEntry<[]>;
|
|
8610
9252
|
/**
|
|
8611
9253
|
* Enforce better string content.
|
|
8612
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9254
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/string-content.md
|
|
8613
9255
|
*/
|
|
8614
9256
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
8615
9257
|
/**
|
|
8616
9258
|
* Enforce consistent brace style for `case` clauses.
|
|
8617
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9259
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/switch-case-braces.md
|
|
8618
9260
|
*/
|
|
8619
9261
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
8620
9262
|
/**
|
|
8621
9263
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
8622
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9264
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/switch-case-break-position.md
|
|
8623
9265
|
*/
|
|
8624
9266
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
8625
9267
|
/**
|
|
8626
9268
|
* Fix whitespace-insensitive template indentation.
|
|
8627
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9269
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/template-indent.md
|
|
8628
9270
|
*/
|
|
8629
9271
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
8630
9272
|
/**
|
|
8631
9273
|
* Enforce consistent case for text encoding identifiers.
|
|
8632
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9274
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/text-encoding-identifier-case.md
|
|
8633
9275
|
*/
|
|
8634
9276
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
8635
9277
|
/**
|
|
8636
9278
|
* Require `new` when creating an error.
|
|
8637
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9279
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/throw-new-error.md
|
|
8638
9280
|
*/
|
|
8639
9281
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
8640
9282
|
/**
|
|
8641
9283
|
* Limit the complexity of `try` blocks.
|
|
8642
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
9284
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/try-complexity.md
|
|
8643
9285
|
*/
|
|
8644
9286
|
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
8645
9287
|
}
|
|
@@ -8648,6 +9290,29 @@ interface RuleOptions$1 {
|
|
|
8648
9290
|
type UnicornCatchErrorName = [] | [{
|
|
8649
9291
|
name?: string;
|
|
8650
9292
|
ignore?: unknown[];
|
|
9293
|
+
}]; // ----- unicorn/class-reference-in-static-methods -----
|
|
9294
|
+
type UnicornClassReferenceInStaticMethods = [] | [{
|
|
9295
|
+
preferThis?: boolean;
|
|
9296
|
+
preferSuper?: boolean;
|
|
9297
|
+
}]; // ----- unicorn/comment-content -----
|
|
9298
|
+
type UnicornCommentContent = [] | [{
|
|
9299
|
+
checkUniformCase?: boolean;
|
|
9300
|
+
extendDefaultReplacements?: boolean;
|
|
9301
|
+
replacements?: {
|
|
9302
|
+
[k: string]: (false | string | {
|
|
9303
|
+
replacement: string;
|
|
9304
|
+
caseSensitive?: boolean;
|
|
9305
|
+
}) | undefined;
|
|
9306
|
+
};
|
|
9307
|
+
}]; // ----- unicorn/consistent-boolean-name -----
|
|
9308
|
+
type UnicornConsistentBooleanName = [] | [{
|
|
9309
|
+
checkProperties?: boolean;
|
|
9310
|
+
prefixes?: {
|
|
9311
|
+
[k: string]: boolean | undefined;
|
|
9312
|
+
};
|
|
9313
|
+
}]; // ----- unicorn/consistent-class-member-order -----
|
|
9314
|
+
type UnicornConsistentClassMemberOrder = [] | [{
|
|
9315
|
+
order?: [("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method")];
|
|
8651
9316
|
}]; // ----- unicorn/consistent-compound-words -----
|
|
8652
9317
|
type UnicornConsistentCompoundWords = [] | [{
|
|
8653
9318
|
checkProperties?: boolean;
|
|
@@ -8664,11 +9329,26 @@ interface _UnicornConsistentCompoundWords_Replacements {
|
|
|
8664
9329
|
}
|
|
8665
9330
|
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
8666
9331
|
[k: string]: true | undefined;
|
|
8667
|
-
} // ----- unicorn/consistent-
|
|
9332
|
+
} // ----- unicorn/consistent-conditional-object-spread -----
|
|
9333
|
+
type UnicornConsistentConditionalObjectSpread = [] | [("logical" | "ternary")]; // ----- unicorn/consistent-export-decorator-position -----
|
|
9334
|
+
type UnicornConsistentExportDecoratorPosition = [] | [("above" | "before" | "after")]; // ----- unicorn/consistent-function-scoping -----
|
|
8668
9335
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
8669
9336
|
checkArrowFunctions?: boolean;
|
|
9337
|
+
}]; // ----- unicorn/consistent-function-style -----
|
|
9338
|
+
type UnicornConsistentFunctionStyle = [] | [{
|
|
9339
|
+
default?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
9340
|
+
namedFunctions?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
9341
|
+
namedExports?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
9342
|
+
callbacks?: ("function-expression" | "arrow-function" | "ignore");
|
|
9343
|
+
objectProperties?: ("method" | "function-expression" | "arrow-function" | "ignore");
|
|
9344
|
+
reassignedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
9345
|
+
typedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
8670
9346
|
}]; // ----- unicorn/consistent-json-file-read -----
|
|
8671
|
-
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/
|
|
9347
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/default-export-style -----
|
|
9348
|
+
type UnicornDefaultExportStyle = [] | [{
|
|
9349
|
+
functions?: ("inline" | "separate" | "ignore");
|
|
9350
|
+
classes?: ("inline" | "separate" | "ignore");
|
|
9351
|
+
}]; // ----- unicorn/dom-node-dataset -----
|
|
8672
9352
|
type UnicornDomNodeDataset = [] | [{
|
|
8673
9353
|
preferAttributes?: boolean;
|
|
8674
9354
|
}]; // ----- unicorn/escape-case -----
|
|
@@ -8683,15 +9363,17 @@ type UnicornExpiringTodoComments = [] | [{
|
|
|
8683
9363
|
}]; // ----- unicorn/explicit-length-check -----
|
|
8684
9364
|
type UnicornExplicitLengthCheck = [] | [{
|
|
8685
9365
|
"non-zero"?: ("greater-than" | "not-equal");
|
|
8686
|
-
}]; // ----- unicorn/
|
|
9366
|
+
}]; // ----- unicorn/explicit-timer-delay -----
|
|
9367
|
+
type UnicornExplicitTimerDelay = [] | [("always" | "never")]; // ----- unicorn/filename-case -----
|
|
8687
9368
|
type UnicornFilenameCase = [] | [({
|
|
8688
|
-
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
9369
|
+
case?: ("camelCase" | "camelCaseWithAcronyms" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
8689
9370
|
ignore?: unknown[];
|
|
8690
9371
|
multipleFileExtensions?: boolean;
|
|
8691
9372
|
checkDirectories?: boolean;
|
|
8692
9373
|
} | {
|
|
8693
9374
|
cases?: {
|
|
8694
9375
|
camelCase?: boolean;
|
|
9376
|
+
camelCaseWithAcronyms?: boolean;
|
|
8695
9377
|
snakeCase?: boolean;
|
|
8696
9378
|
kebabCase?: boolean;
|
|
8697
9379
|
pascalCase?: boolean;
|
|
@@ -8699,7 +9381,14 @@ type UnicornFilenameCase = [] | [({
|
|
|
8699
9381
|
ignore?: unknown[];
|
|
8700
9382
|
multipleFileExtensions?: boolean;
|
|
8701
9383
|
checkDirectories?: boolean;
|
|
8702
|
-
})]; // ----- unicorn/
|
|
9384
|
+
})]; // ----- unicorn/id-match -----
|
|
9385
|
+
type UnicornIdMatch = [] | [string] | [string, {
|
|
9386
|
+
properties?: boolean;
|
|
9387
|
+
classFields?: boolean;
|
|
9388
|
+
onlyDeclarations?: boolean;
|
|
9389
|
+
ignoreDestructuring?: boolean;
|
|
9390
|
+
checkNamedSpecifiers?: boolean;
|
|
9391
|
+
}]; // ----- unicorn/import-style -----
|
|
8703
9392
|
type UnicornImportStyle = [] | [{
|
|
8704
9393
|
checkImport?: boolean;
|
|
8705
9394
|
checkDynamicImport?: boolean;
|
|
@@ -8722,7 +9411,36 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
8722
9411
|
functions?: string[];
|
|
8723
9412
|
selectors?: string[];
|
|
8724
9413
|
comments?: string[];
|
|
8725
|
-
}]; // ----- unicorn/
|
|
9414
|
+
}]; // ----- unicorn/logical-assignment-operators -----
|
|
9415
|
+
type UnicornLogicalAssignmentOperators = (([] | ["always"] | ["always", {
|
|
9416
|
+
enforceForIfStatements?: boolean;
|
|
9417
|
+
}] | ["never"]) & unknown[]); // ----- unicorn/max-nested-calls -----
|
|
9418
|
+
type UnicornMaxNestedCalls = [] | [{
|
|
9419
|
+
max?: number;
|
|
9420
|
+
}]; // ----- unicorn/name-replacements -----
|
|
9421
|
+
type UnicornNameReplacements = [] | [{
|
|
9422
|
+
checkProperties?: boolean;
|
|
9423
|
+
checkVariables?: boolean;
|
|
9424
|
+
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
9425
|
+
checkShorthandImports?: (boolean | string);
|
|
9426
|
+
checkShorthandProperties?: boolean;
|
|
9427
|
+
checkFilenames?: boolean;
|
|
9428
|
+
extendDefaultReplacements?: boolean;
|
|
9429
|
+
replacements?: _UnicornNameReplacements_NameReplacements;
|
|
9430
|
+
extendDefaultAllowList?: boolean;
|
|
9431
|
+
allowList?: _UnicornNameReplacements_BooleanObject;
|
|
9432
|
+
ignore?: unknown[];
|
|
9433
|
+
}];
|
|
9434
|
+
type _UnicornNameReplacementsReplacements = (false | _UnicornNameReplacements_BooleanObject) | undefined;
|
|
9435
|
+
interface _UnicornNameReplacements_NameReplacements {
|
|
9436
|
+
[k: string]: _UnicornNameReplacementsReplacements | undefined;
|
|
9437
|
+
}
|
|
9438
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
9439
|
+
[k: string]: boolean | undefined;
|
|
9440
|
+
}
|
|
9441
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
9442
|
+
[k: string]: boolean | undefined;
|
|
9443
|
+
} // ----- unicorn/no-array-callback-reference -----
|
|
8726
9444
|
type UnicornNoArrayCallbackReference = [] | [{
|
|
8727
9445
|
ignore?: string[];
|
|
8728
9446
|
}]; // ----- unicorn/no-array-reduce -----
|
|
@@ -8743,11 +9461,23 @@ type UnicornNoInstanceofBuiltins = [] | [{
|
|
|
8743
9461
|
strategy?: ("loose" | "strict");
|
|
8744
9462
|
include?: string[];
|
|
8745
9463
|
exclude?: string[];
|
|
9464
|
+
}]; // ----- unicorn/no-invalid-argument-count -----
|
|
9465
|
+
type UnicornNoInvalidArgumentCount = [] | [{
|
|
9466
|
+
[k: string]: (number | [number, ...(number)[]] | {
|
|
9467
|
+
min?: number;
|
|
9468
|
+
max?: number;
|
|
9469
|
+
}) | undefined;
|
|
8746
9470
|
}]; // ----- unicorn/no-keyword-prefix -----
|
|
8747
9471
|
type UnicornNoKeywordPrefix = [] | [{
|
|
8748
9472
|
disallowedPrefixes?: [] | [string];
|
|
8749
9473
|
checkProperties?: boolean;
|
|
8750
9474
|
onlyCamelCase?: boolean;
|
|
9475
|
+
}]; // ----- unicorn/no-negated-comparison -----
|
|
9476
|
+
type UnicornNoNegatedComparison = [] | [{
|
|
9477
|
+
checkLogicalExpressions?: boolean;
|
|
9478
|
+
}]; // ----- unicorn/no-non-function-verb-prefix -----
|
|
9479
|
+
type UnicornNoNonFunctionVerbPrefix = [] | [{
|
|
9480
|
+
verbs?: string[];
|
|
8751
9481
|
}]; // ----- unicorn/no-null -----
|
|
8752
9482
|
type UnicornNoNull = [] | [{
|
|
8753
9483
|
checkArguments?: boolean;
|
|
@@ -8760,6 +9490,9 @@ type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
|
8760
9490
|
targets?: (string | unknown[] | {
|
|
8761
9491
|
[k: string]: unknown | undefined;
|
|
8762
9492
|
});
|
|
9493
|
+
}]; // ----- unicorn/no-unreadable-array-destructuring -----
|
|
9494
|
+
type UnicornNoUnreadableArrayDestructuring = [] | [{
|
|
9495
|
+
maximumIgnoredElements?: number;
|
|
8763
9496
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
8764
9497
|
type UnicornNoUselessUndefined = [] | [{
|
|
8765
9498
|
checkArguments?: boolean;
|
|
@@ -8791,7 +9524,8 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
8791
9524
|
fractionGroupLength?: number;
|
|
8792
9525
|
};
|
|
8793
9526
|
onlyIfContainsSeparator?: boolean;
|
|
8794
|
-
}]; // ----- unicorn/
|
|
9527
|
+
}]; // ----- unicorn/operator-assignment -----
|
|
9528
|
+
type UnicornOperatorAssignment = [] | [("always" | "never")]; // ----- unicorn/prefer-add-event-listener -----
|
|
8795
9529
|
type UnicornPreferAddEventListener = [] | [{
|
|
8796
9530
|
excludedPackages?: string[];
|
|
8797
9531
|
}]; // ----- unicorn/prefer-array-find -----
|
|
@@ -8804,12 +9538,21 @@ type UnicornPreferArrayFlat = [] | [{
|
|
|
8804
9538
|
type UnicornPreferAt = [] | [{
|
|
8805
9539
|
getLastElementFunctions?: unknown[];
|
|
8806
9540
|
checkAllIndexAccess?: boolean;
|
|
9541
|
+
}]; // ----- unicorn/prefer-continue -----
|
|
9542
|
+
type UnicornPreferContinue = [] | [{
|
|
9543
|
+
maximumStatements?: number;
|
|
9544
|
+
}]; // ----- unicorn/prefer-early-return -----
|
|
9545
|
+
type UnicornPreferEarlyReturn = [] | [{
|
|
9546
|
+
maximumStatements?: number;
|
|
8807
9547
|
}]; // ----- unicorn/prefer-export-from -----
|
|
8808
9548
|
type UnicornPreferExportFrom = [] | [{
|
|
8809
9549
|
checkUsedVariables?: boolean;
|
|
8810
9550
|
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
8811
9551
|
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
8812
9552
|
minimumComparisons?: number;
|
|
9553
|
+
}]; // ----- unicorn/prefer-minimal-ternary -----
|
|
9554
|
+
type UnicornPreferMinimalTernary = [] | [{
|
|
9555
|
+
checkComputedMemberAccess?: boolean;
|
|
8813
9556
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
8814
9557
|
type UnicornPreferNumberProperties = [] | [{
|
|
8815
9558
|
checkInfinity?: boolean;
|
|
@@ -8840,31 +9583,13 @@ type UnicornPreferStructuredClone = [] | [{
|
|
|
8840
9583
|
type UnicornPreferSwitch = [] | [{
|
|
8841
9584
|
minimumCases?: number;
|
|
8842
9585
|
emptyDefaultCase?: ("no-default-comment" | "do-nothing-comment" | "no-default-case");
|
|
9586
|
+
}]; // ----- unicorn/prefer-temporal -----
|
|
9587
|
+
type UnicornPreferTemporal = [] | [{
|
|
9588
|
+
checkDateNow?: boolean;
|
|
9589
|
+
checkReferences?: boolean;
|
|
9590
|
+
checkMethods?: boolean;
|
|
8843
9591
|
}]; // ----- unicorn/prefer-ternary -----
|
|
8844
|
-
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/
|
|
8845
|
-
type UnicornPreventAbbreviations = [] | [{
|
|
8846
|
-
checkProperties?: boolean;
|
|
8847
|
-
checkVariables?: boolean;
|
|
8848
|
-
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
8849
|
-
checkShorthandImports?: (boolean | string);
|
|
8850
|
-
checkShorthandProperties?: boolean;
|
|
8851
|
-
checkFilenames?: boolean;
|
|
8852
|
-
extendDefaultReplacements?: boolean;
|
|
8853
|
-
replacements?: _UnicornPreventAbbreviations_Abbreviations;
|
|
8854
|
-
extendDefaultAllowList?: boolean;
|
|
8855
|
-
allowList?: _UnicornPreventAbbreviations_BooleanObject;
|
|
8856
|
-
ignore?: unknown[];
|
|
8857
|
-
}];
|
|
8858
|
-
type _UnicornPreventAbbreviationsReplacements = (false | _UnicornPreventAbbreviations_BooleanObject) | undefined;
|
|
8859
|
-
interface _UnicornPreventAbbreviations_Abbreviations {
|
|
8860
|
-
[k: string]: _UnicornPreventAbbreviationsReplacements | undefined;
|
|
8861
|
-
}
|
|
8862
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
8863
|
-
[k: string]: boolean | undefined;
|
|
8864
|
-
}
|
|
8865
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
8866
|
-
[k: string]: boolean | undefined;
|
|
8867
|
-
} // ----- unicorn/relative-url-style -----
|
|
9592
|
+
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/relative-url-style -----
|
|
8868
9593
|
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
8869
9594
|
type UnicornRequireCssEscape = [] | [{
|
|
8870
9595
|
checkAllSelectors?: boolean;
|
|
@@ -8880,7 +9605,7 @@ type UnicornStringContent = [] | [{
|
|
|
8880
9605
|
};
|
|
8881
9606
|
selectors?: string[];
|
|
8882
9607
|
}]; // ----- unicorn/switch-case-braces -----
|
|
8883
|
-
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
9608
|
+
type UnicornSwitchCaseBraces = [] | [("always" | "avoid" | "single-statement")]; // ----- unicorn/template-indent -----
|
|
8884
9609
|
type UnicornTemplateIndent = [] | [{
|
|
8885
9610
|
indent?: (string | number);
|
|
8886
9611
|
tags?: string[];
|
|
@@ -9009,6 +9734,11 @@ interface RuleOptions {
|
|
|
9009
9734
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html
|
|
9010
9735
|
*/
|
|
9011
9736
|
'yml/no-tab-indent'?: Linter.RuleEntry<[]>;
|
|
9737
|
+
/**
|
|
9738
|
+
* disallow trailing whitespace at the end of lines
|
|
9739
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-spaces.html
|
|
9740
|
+
*/
|
|
9741
|
+
'yml/no-trailing-spaces'?: Linter.RuleEntry<YmlNoTrailingSpaces>;
|
|
9012
9742
|
/**
|
|
9013
9743
|
* disallow trailing zeros for floats
|
|
9014
9744
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-zeros.html
|
|
@@ -9155,6 +9885,10 @@ type YmlNoMultipleEmptyLines = [] | [{
|
|
|
9155
9885
|
max: number;
|
|
9156
9886
|
maxEOF?: number;
|
|
9157
9887
|
maxBOF?: number;
|
|
9888
|
+
}]; // ----- yml/no-trailing-spaces -----
|
|
9889
|
+
type YmlNoTrailingSpaces = [] | [{
|
|
9890
|
+
skipBlankLines?: boolean;
|
|
9891
|
+
ignoreComments?: boolean;
|
|
9158
9892
|
}]; // ----- yml/plain-scalar -----
|
|
9159
9893
|
type YmlPlainScalar = [] | [("always" | "never")] | [("always" | "never"), {
|
|
9160
9894
|
ignorePatterns?: string[];
|