@alexlit/lint-kit 176.0.0 → 177.0.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/package.json +1 -1
- package/packages/config-eslint/package.json +1 -1
- package/packages/config-eslint/plugins/vue.js +6 -0
- package/packages/config-stylelint/package.json +5 -5
- package/packages/config-stylelint/plugins/color-format.js +1 -5
- package/packages/config-stylelint/plugins/logical-css.js +1 -4
- package/packages/config-eslint/node_modules/@eslint/core/LICENSE +0 -201
- package/packages/config-eslint/node_modules/@eslint/core/README.md +0 -29
- package/packages/config-eslint/node_modules/@eslint/core/dist/cjs/types.d.cts +0 -1179
- package/packages/config-eslint/node_modules/@eslint/core/dist/esm/types.d.ts +0 -1179
- package/packages/config-eslint/node_modules/@eslint/core/package.json +0 -49
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/LICENSE +0 -201
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/README.md +0 -273
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/cjs/index.cjs +0 -884
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts +0 -328
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/cjs/types.cts +0 -7
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/esm/index.d.ts +0 -328
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/esm/index.js +0 -879
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/esm/types.d.ts +0 -6
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/dist/esm/types.ts +0 -7
- package/packages/config-eslint/node_modules/@eslint/plugin-kit/package.json +0 -61
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/configs/flat-config-base.js +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/index.d.ts +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/index.js +0 -91
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/license +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/globals.json +0 -3345
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/index.d.ts +0 -3452
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/index.js +0 -2
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/license +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/package.json +0 -117
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/node_modules/globals/readme.md +0 -42
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/package.json +0 -128
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/readme.md +0 -261
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/call-or-new-expression.js +0 -120
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/function-types.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/index.js +0 -30
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-arrow-function-body.js +0 -3
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-directive.js +0 -4
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-empty-array-expression.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-empty-node.js +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-expression-statement.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-function.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-member-expression.js +0 -98
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-method-call.js +0 -62
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-negative-one.js +0 -8
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-reference-identifier.js +0 -159
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-static-require.js +0 -10
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-tagged-template-literal.js +0 -24
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/is-undefined.js +0 -3
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/ast/literal.js +0 -24
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/better-regex.js +0 -146
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/catch-error-name.js +0 -138
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-assert.js +0 -98
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-date-clone.js +0 -54
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-destructuring.js +0 -168
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-empty-array-spread.js +0 -127
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-existence-index-check.js +0 -137
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/consistent-function-scoping.js +0 -265
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/custom-error-definition.js +0 -218
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/empty-brace-spaces.js +0 -62
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/error-message.js +0 -98
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/escape-case.js +0 -86
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/expiring-todo-comments.js +0 -584
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/explicit-length-check.js +0 -236
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/filename-case.js +0 -276
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/add-parenthesizes-to-return-or-throw-expression.js +0 -29
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/append-argument.js +0 -30
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/extend-fix-range.js +0 -11
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/fix-space-around-keywords.js +0 -43
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/index.js +0 -23
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-argument.js +0 -40
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-expression-statement.js +0 -34
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-method-call.js +0 -28
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-object-property.js +0 -21
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-parentheses.js +0 -19
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-spaces-after.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/remove-specifier.js +0 -59
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/rename-variable.js +0 -8
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-argument.js +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-member-expression-property.js +0 -25
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-node-or-token-and-spaces-before.js +0 -31
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-reference-identifier.js +0 -32
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-string-raw.js +0 -12
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/replace-template-element.js +0 -10
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/switch-call-expression-to-new-expression.js +0 -29
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/fix/switch-new-expression-to-call-expression.js +0 -42
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/import-style.js +0 -375
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/index.js +0 -143
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/new-for-builtins.js +0 -112
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-abusive-eslint-disable.js +0 -63
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-accessor-recursion.js +0 -160
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-anonymous-default-export.js +0 -210
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-callback-reference.js +0 -285
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-for-each.js +0 -496
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-method-this-argument.js +0 -223
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-reduce.js +0 -128
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-reverse.js +0 -6
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-array-sort.js +0 -6
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-await-expression-member.js +0 -85
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-await-in-promise-methods.js +0 -69
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-console-spaces.js +0 -89
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-document-cookie.js +0 -27
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-empty-file.js +0 -58
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-for-loop.js +0 -419
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-hex-escape.js +0 -54
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-immediate-mutation.js +0 -778
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-instanceof-builtins.js +0 -216
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-invalid-fetch-options.js +0 -112
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-invalid-remove-event-listener.js +0 -61
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-keyword-prefix.js +0 -202
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-lonely-if.js +0 -155
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-magic-array-flat-depth.js +0 -55
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-named-default.js +0 -101
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-negated-condition.js +0 -145
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-negation-in-equality-check.js +0 -99
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-nested-ternary.js +0 -60
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-new-array.js +0 -106
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-new-buffer.js +0 -100
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-null.js +0 -153
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-object-as-default-parameter.js +0 -52
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-process-exit.js +0 -106
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-single-promise-in-promise-methods.js +0 -179
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-static-only-class.js +0 -226
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-thenable.js +0 -194
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-this-assignment.js +0 -40
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-typeof-undefined.js +0 -146
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unnecessary-array-flat-depth.js +0 -49
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unnecessary-array-splice-count.js +0 -23
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unnecessary-await.js +0 -110
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unnecessary-polyfills.js +0 -174
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unnecessary-slice-end.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unreadable-array-destructuring.js +0 -85
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unreadable-iife.js +0 -43
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-unused-properties.js +0 -240
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-collection-argument.js +0 -101
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-error-capture-stack-trace.js +0 -146
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-fallback-in-spread.js +0 -66
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-length-check.js +0 -150
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-promise-resolve-reject.js +0 -210
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-spread.js +0 -389
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-switch-case.js +0 -59
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-useless-undefined.js +0 -275
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/no-zero-fractions.js +0 -81
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/number-literal-case.js +0 -82
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/numeric-separators-style.js +0 -189
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-add-event-listener.js +0 -191
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-array-find.js +0 -458
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-array-flat-map.js +0 -86
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-array-flat.js +0 -279
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-array-index-of.js +0 -34
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-array-some.js +0 -219
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-at.js +0 -380
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-bigint-literals.js +0 -129
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-blob-reading-methods.js +0 -47
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-class-fields.js +0 -158
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-classlist-toggle.js +0 -255
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-code-point.js +0 -56
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-date-now.js +0 -133
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-default-parameters.js +0 -218
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-dom-node-append.js +0 -50
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-dom-node-dataset.js +0 -135
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-dom-node-remove.js +0 -124
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-dom-node-text-content.js +0 -77
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-event-target.js +0 -119
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-export-from.js +0 -367
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-global-this.js +0 -222
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-import-meta-properties.js +0 -320
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-includes.js +0 -111
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-json-parse-buffer.js +0 -161
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-keyboard-event-key.js +0 -188
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-logical-operator-over-ternary.js +0 -162
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-math-min-max.js +0 -205
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-math-trunc.js +0 -111
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-modern-dom-apis.js +0 -145
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-modern-math-apis.js +0 -210
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-module.js +0 -377
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-native-coercion-functions.js +0 -187
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-negative-index.js +0 -211
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-node-protocol.js +0 -86
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-number-properties.js +0 -142
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-object-from-entries.js +0 -256
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-optional-catch-binding.js +0 -77
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-prototype-methods.js +0 -162
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-query-selector.js +0 -170
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-reflect-apply.js +0 -99
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-regexp-test.js +0 -155
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-response-static-json.js +0 -85
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-set-has.js +0 -181
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-set-size.js +0 -106
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-single-call.js +0 -188
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-spread.js +0 -521
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-string-raw.js +0 -149
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-string-replace-all.js +0 -180
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-string-slice.js +0 -180
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-string-starts-ends-with.js +0 -201
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-string-trim-start-end.js +0 -46
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-structured-clone.js +0 -149
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-switch.js +0 -357
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-ternary.js +0 -288
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-top-level-await.js +0 -154
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prefer-type-error.js +0 -169
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js +0 -655
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/relative-url-style.js +0 -171
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/require-array-join-separator.js +0 -65
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/require-module-attributes.js +0 -120
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/require-module-specifiers.js +0 -158
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/require-number-to-fixed-digits-argument.js +0 -55
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/require-post-message-target-origin.js +0 -74
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/get-documentation-url.js +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/index.js +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-create.js +0 -51
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-listener.js +0 -40
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-problem.js +0 -38
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-rule-fixer.js +0 -49
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-rule.js +0 -38
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/to-eslint-rules.js +0 -13
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/unicorn-context.js +0 -36
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/unicorn-listeners.js +0 -65
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/rule/utilities.js +0 -27
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/abbreviations.js +0 -270
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/builtin-errors.js +0 -14
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/dom-events.js +0 -275
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/event-keys.js +0 -54
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/negative-index.js +0 -52
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/no-array-mutate-rule.js +0 -139
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/no-unnecessary-length-or-infinity-rule.js +0 -80
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/package-json.js +0 -42
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/simple-array-search-rule.js +0 -126
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/shared/typed-array.js +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/string-content.js +0 -192
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/switch-case-braces.js +0 -114
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/template-indent.js +0 -219
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/text-encoding-identifier-case.js +0 -130
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/throw-new-error.js +0 -60
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/array-or-object-prototype-property.js +0 -57
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/assert-token.js +0 -29
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/boolean.js +0 -88
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/builtins.js +0 -30
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/cartesian-product-samples.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/create-deprecated-rules.js +0 -29
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/escape-string.js +0 -24
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/escape-template-element-raw.js +0 -6
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-ancestor.js +0 -15
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-available-variable-name.js +0 -147
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-builtin-rule.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-call-expression-arguments-text.js +0 -36
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-call-or-new-expression-tokens.js +0 -67
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-class-head-location.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-documentation-url.js +0 -9
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-indent-string.js +0 -18
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-references.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-scopes.js +0 -12
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-sibling-node.js +0 -38
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-switch-case-head-location.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-token-store.js +0 -24
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-variable-identifiers.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/global-reference-tracker.js +0 -68
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/has-optional-chain-element.js +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/has-same-range.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/index.js +0 -59
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-function-self-used-inside.js +0 -39
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-left-hand-side.js +0 -20
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-logical-expression.js +0 -14
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-method-named.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-new-expression-with-parentheses.js +0 -28
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-node-matches.js +0 -58
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-node-value-not-dom-node.js +0 -20
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-node-value-not-function.js +0 -40
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-number.js +0 -224
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-object-method.js +0 -10
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-on-same-line.js +0 -7
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-same-identifier.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-same-reference.js +0 -170
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-shorthand-export-local.js +0 -8
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-shorthand-import-local.js +0 -8
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-shorthand-property-assignment-pattern-left.js +0 -8
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-shorthand-property-value.js +0 -6
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-unresolved-variable.js +0 -14
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-value-not-usable.js +0 -5
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/needs-semicolon.js +0 -118
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/numeric.js +0 -49
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/parentheses.js +0 -71
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/resolve-variable-name.js +0 -18
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/rule.js +0 -27
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-await-expression-argument.js +0 -17
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-call-expression-callee.js +0 -18
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-conditional-expression-child.js +0 -13
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-expression-statement-expression.js +0 -22
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-logical-expression-child.js +0 -43
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-member-expression-object.js +0 -47
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-new-expression-callee.js +0 -28
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/should-add-parentheses-to-unary-expression.js +0 -24
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/singular.js +0 -16
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/string-cases.js +0 -2
- package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/to-location.js +0 -25
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {isOpeningParenToken, isCommaToken} from '@eslint-community/eslint-utils';
|
|
2
|
-
import isNewExpressionWithParentheses from './is-new-expression-with-parentheses.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
6
|
-
@import * as ESLint from 'eslint';
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
@typedef {{
|
|
11
|
-
openingParenthesisToken: ESLint.AST.Token,
|
|
12
|
-
closingParenthesisToken: ESLint.AST.Token,
|
|
13
|
-
trailingCommaToken: ESLint.AST.Token | undefined,
|
|
14
|
-
}} Tokens
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
Get the `openingParenthesisToken`, `closingParenthesisToken`, and `trailingCommaToken` of `CallExpression`.
|
|
19
|
-
|
|
20
|
-
@param {ESTree.CallExpression | ESTree.NewExpression} callOrNewExpression - The `CallExpression` or `newExpression` node.
|
|
21
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
22
|
-
@returns {Tokens}
|
|
23
|
-
*/
|
|
24
|
-
function getCallOrNewExpressionTokens(callOrNewExpression, context) {
|
|
25
|
-
const {sourceCode} = context;
|
|
26
|
-
const startToken = callOrNewExpression.typeArguments ?? callOrNewExpression.callee;
|
|
27
|
-
const openingParenthesisToken = sourceCode.getTokenAfter(startToken, isOpeningParenToken);
|
|
28
|
-
const [
|
|
29
|
-
penultimateToken,
|
|
30
|
-
closingParenthesisToken,
|
|
31
|
-
] = sourceCode.getLastTokens(callOrNewExpression, 2);
|
|
32
|
-
const trailingCommaToken = isCommaToken(penultimateToken) ? penultimateToken : undefined;
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
openingParenthesisToken,
|
|
36
|
-
closingParenthesisToken,
|
|
37
|
-
trailingCommaToken,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
Get the `openingParenthesisToken`, `closingParenthesisToken`, and `trailingCommaToken` of `NewExpression`.
|
|
43
|
-
|
|
44
|
-
@param {ESTree.NewExpression} newExpression - The `newExpression` node.
|
|
45
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
46
|
-
@returns {Tokens}
|
|
47
|
-
*/
|
|
48
|
-
function getNewExpressionTokens(newExpression, context) {
|
|
49
|
-
if (!isNewExpressionWithParentheses(newExpression, context)) {
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return getCallOrNewExpressionTokens(newExpression, context);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
Get the `openingParenthesisToken`, `closingParenthesisToken`, and `trailingCommaToken` of `CallExpression`.
|
|
58
|
-
|
|
59
|
-
@param {ESTree.CallExpression} callExpression - The `callExpression` node.
|
|
60
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
61
|
-
@returns {Tokens}
|
|
62
|
-
*/
|
|
63
|
-
function getCallExpressionTokens(callExpression, context) {
|
|
64
|
-
return getCallOrNewExpressionTokens(callExpression, context);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export {getCallExpressionTokens, getNewExpressionTokens};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
3
|
-
@import * as ESLint from 'eslint';
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
Get the location of the given class node for reporting.
|
|
8
|
-
|
|
9
|
-
@param {ESTree.ClassDeclaration | ESTree.ClassExpression} node - The class node to get.
|
|
10
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
11
|
-
@returns {ESTree.SourceLocation} The location of the class node for reporting.
|
|
12
|
-
*/
|
|
13
|
-
export default function getClassHeadLocation(node, context) {
|
|
14
|
-
const {sourceCode} = context;
|
|
15
|
-
const {body} = node;
|
|
16
|
-
const tokenBeforeBody = sourceCode.getTokenBefore(body);
|
|
17
|
-
|
|
18
|
-
const {start} = sourceCode.getLoc(node);
|
|
19
|
-
const {end} = sourceCode.getLoc(tokenBeforeBody);
|
|
20
|
-
|
|
21
|
-
return {start, end};
|
|
22
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import packageJson from '../../package.json' with {type: 'json'};
|
|
3
|
-
|
|
4
|
-
const repoUrl = 'https://github.com/sindresorhus/eslint-plugin-unicorn';
|
|
5
|
-
|
|
6
|
-
export default function getDocumentationUrl(filename) {
|
|
7
|
-
const ruleName = path.basename(filename, '.js');
|
|
8
|
-
return `${repoUrl}/blob/v${packageJson.version}/docs/rules/${ruleName}.md`;
|
|
9
|
-
}
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-indent-string.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
3
|
-
@import * as ESLint from 'eslint';
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
@param {ESTree.Node} node - The class node to get.
|
|
8
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
9
|
-
@returns {string}.
|
|
10
|
-
*/
|
|
11
|
-
export default function getIndentString(node, context) {
|
|
12
|
-
const {sourceCode} = context;
|
|
13
|
-
const {start: {line, column}} = sourceCode.getLoc(node);
|
|
14
|
-
const lines = sourceCode.getLines();
|
|
15
|
-
const before = lines[line - 1].slice(0, column);
|
|
16
|
-
|
|
17
|
-
return before.match(/\s*$/)[0];
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Gather a list of all Scopes starting recursively from the input Scope.
|
|
3
|
-
|
|
4
|
-
@param {Scope} scope - The Scope to start checking from.
|
|
5
|
-
@returns {Scope[]} - The resulting Scopes.
|
|
6
|
-
*/
|
|
7
|
-
const getScopes = scope => [
|
|
8
|
-
scope,
|
|
9
|
-
...scope.childScopes.flatMap(scope => getScopes(scope)),
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export default getScopes;
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-sibling-node.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
3
|
-
@import * as ESLint from 'eslint';
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
@param {ESTree.Node} node
|
|
8
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
9
|
-
@param {1 | -1} offset
|
|
10
|
-
*/
|
|
11
|
-
function getSiblingNode(node, context, offset) {
|
|
12
|
-
const {parent} = node;
|
|
13
|
-
const visitorKeys = context.sourceCode.visitorKeys[parent.type] || Object.keys(parent);
|
|
14
|
-
|
|
15
|
-
for (const property of visitorKeys) {
|
|
16
|
-
const value = parent[property];
|
|
17
|
-
|
|
18
|
-
if (value !== node && Array.isArray(value)) {
|
|
19
|
-
const index = value.indexOf(node);
|
|
20
|
-
|
|
21
|
-
if (index !== -1) {
|
|
22
|
-
return value[index + offset];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
@param {ESTree.Node} node
|
|
30
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
31
|
-
*/
|
|
32
|
-
export const getPreviousNode = (node, context) => getSiblingNode(node, context, -1);
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
@param {ESTree.Node} node
|
|
36
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
37
|
-
*/
|
|
38
|
-
export const getNextNode = (node, context) => getSiblingNode(node, context, 1);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {isColonToken} from '@eslint-community/eslint-utils';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
5
|
-
@import * as ESLint from 'eslint';
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
@typedef {line: number, column: number} Position
|
|
10
|
-
|
|
11
|
-
Get the location of the given `SwitchCase` node for reporting.
|
|
12
|
-
|
|
13
|
-
@param {ESTree.SwitchCase} node - The `SwitchCase` node to get.
|
|
14
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
15
|
-
@returns {{start: Position, end: Position}} The location of the class node for reporting.
|
|
16
|
-
*/
|
|
17
|
-
export default function getSwitchCaseHeadLocation(node, context) {
|
|
18
|
-
const {sourceCode} = context;
|
|
19
|
-
const startToken = node.test || sourceCode.getFirstToken(node);
|
|
20
|
-
const colonToken = sourceCode.getTokenAfter(startToken, isColonToken);
|
|
21
|
-
return {start: sourceCode.getLoc(node).start, end: sourceCode.getLoc(colonToken).end};
|
|
22
|
-
}
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/get-token-store.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// When parsing with `vue-eslint-parser`, we need to use `getTemplateBodyTokenStore()` to get a token inside a `<template>`, and `sourceCode` to get a token inside a `<script>`.
|
|
2
|
-
// https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2704/files#r2209196626
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
@param {import('eslint').Rule.RuleContext} context
|
|
6
|
-
@param {import('estree').Node} node
|
|
7
|
-
@returns {import('eslint').SourceCode}
|
|
8
|
-
*/
|
|
9
|
-
function getTokenStore(context, node) {
|
|
10
|
-
const {sourceCode} = context;
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
sourceCode.parserServices.getTemplateBodyTokenStore
|
|
14
|
-
&& sourceCode.ast.templateBody
|
|
15
|
-
&& sourceCode.getRange(sourceCode.ast.templateBody)[0] <= sourceCode.getRange(node)[0]
|
|
16
|
-
&& sourceCode.getRange(node)[1] <= sourceCode.getRange(sourceCode.ast.templateBody)[1]
|
|
17
|
-
) {
|
|
18
|
-
return sourceCode.parserServices.getTemplateBodyTokenStore();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return sourceCode;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default getTokenStore;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {ReferenceTracker} from '@eslint-community/eslint-utils';
|
|
2
|
-
|
|
3
|
-
const createTraceMap = (object, type) => {
|
|
4
|
-
let map = {[type]: true};
|
|
5
|
-
|
|
6
|
-
const path = object.split('.').toReversed();
|
|
7
|
-
for (const name of path) {
|
|
8
|
-
map = {[name]: map};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return map;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export class GlobalReferenceTracker {
|
|
15
|
-
#traceMap = {};
|
|
16
|
-
#context;
|
|
17
|
-
#filter;
|
|
18
|
-
#handle;
|
|
19
|
-
|
|
20
|
-
constructor({
|
|
21
|
-
object,
|
|
22
|
-
objects = [object],
|
|
23
|
-
type = ReferenceTracker.READ,
|
|
24
|
-
|
|
25
|
-
context,
|
|
26
|
-
filter,
|
|
27
|
-
handle,
|
|
28
|
-
}) {
|
|
29
|
-
for (const object of objects) {
|
|
30
|
-
Object.assign(this.#traceMap, createTraceMap(object, type));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
this.#context = context;
|
|
34
|
-
this.#filter = filter;
|
|
35
|
-
this.#handle = handle;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
* #track(globalScope, options) {
|
|
39
|
-
const context = options?.context ?? this.#context;
|
|
40
|
-
const filter = options?.filter ?? this.#filter;
|
|
41
|
-
const handle = options?.handle ?? this.#handle;
|
|
42
|
-
const tracker = new ReferenceTracker(globalScope);
|
|
43
|
-
|
|
44
|
-
for (const reference of tracker.iterateGlobalReferences(this.#traceMap)) {
|
|
45
|
-
if (filter && !filter(reference)) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const problems = handle(reference, context);
|
|
50
|
-
|
|
51
|
-
yield problems;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
listen(options) {
|
|
56
|
-
const context = options?.context ?? this.#context;
|
|
57
|
-
context.onExit(
|
|
58
|
-
'Program',
|
|
59
|
-
program => this.#track(context.sourceCode.getScope(program), options),
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
Object.assign(GlobalReferenceTracker, {
|
|
65
|
-
READ: ReferenceTracker.READ,
|
|
66
|
-
CALL: ReferenceTracker.CALL,
|
|
67
|
-
CONSTRUCT: ReferenceTracker.CONSTRUCT,
|
|
68
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const isChainElement = node => node.type === 'MemberExpression' || node.type === 'CallExpression';
|
|
2
|
-
|
|
3
|
-
export default function hasOptionalChainElement(node) {
|
|
4
|
-
if (!isChainElement(node)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (node.optional) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (node.type === 'MemberExpression') {
|
|
13
|
-
return hasOptionalChainElement(node.object);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return false;
|
|
17
|
-
}
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/has-same-range.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const hasSameRange = (node1, node2, context) =>
|
|
2
|
-
node1
|
|
3
|
-
&& node2
|
|
4
|
-
&& context.sourceCode.getRange(node1)[0] === context.sourceCode.getRange(node2)[0]
|
|
5
|
-
&& context.sourceCode.getRange(node1)[1] === context.sourceCode.getRange(node2)[1];
|
|
6
|
-
|
|
7
|
-
export default hasSameRange;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
isParenthesized,
|
|
3
|
-
getParentheses,
|
|
4
|
-
getParenthesizedRange,
|
|
5
|
-
getParenthesizedText,
|
|
6
|
-
} from './parentheses.js';
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
isArrayPrototypeProperty,
|
|
10
|
-
isObjectPrototypeProperty,
|
|
11
|
-
} from './array-or-object-prototype-property.js';
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
isNodeMatches,
|
|
15
|
-
isNodeMatchesNameOrPath,
|
|
16
|
-
} from './is-node-matches.js';
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
isBooleanNode,
|
|
20
|
-
getBooleanAncestor,
|
|
21
|
-
} from './boolean.js';
|
|
22
|
-
|
|
23
|
-
export {default as cartesianProductSamples} from './cartesian-product-samples.js';
|
|
24
|
-
export {default as escapeString} from './escape-string.js';
|
|
25
|
-
export {default as getAvailableVariableName} from './get-available-variable-name.js';
|
|
26
|
-
export {default as getCallExpressionArgumentsText} from './get-call-expression-arguments-text.js';
|
|
27
|
-
export {getCallExpressionTokens, getNewExpressionTokens} from './get-call-or-new-expression-tokens.js';
|
|
28
|
-
export {default as getIndentString} from './get-indent-string.js';
|
|
29
|
-
export {default as getReferences} from './get-references.js';
|
|
30
|
-
export {default as getScopes} from './get-scopes.js';
|
|
31
|
-
export {default as getTokenStore} from './get-token-store.js';
|
|
32
|
-
export {default as getVariableIdentifiers} from './get-variable-identifiers.js';
|
|
33
|
-
export {default as hasOptionalChainElement} from './has-optional-chain-element.js';
|
|
34
|
-
export {default as isFunctionSelfUsedInside} from './is-function-self-used-inside.js';
|
|
35
|
-
export {default as isLeftHandSide} from './is-left-hand-side.js';
|
|
36
|
-
export {default as isLogicalExpression} from './is-logical-expression.js';
|
|
37
|
-
export {default as isMethodNamed} from './is-method-named.js';
|
|
38
|
-
export {default as isNodeValueNotDomNode} from './is-node-value-not-dom-node.js';
|
|
39
|
-
export {default as isNodeValueNotFunction} from './is-node-value-not-function.js';
|
|
40
|
-
export {default as isOnSameLine} from './is-on-same-line.js';
|
|
41
|
-
export {default as isSameIdentifier} from './is-same-identifier.js';
|
|
42
|
-
export {default as isSameReference} from './is-same-reference.js';
|
|
43
|
-
export {default as isUnresolvedVariable} from './is-unresolved-variable.js';
|
|
44
|
-
export {default as isShorthandImportLocal} from './is-shorthand-import-local.js';
|
|
45
|
-
export {default as isShorthandPropertyValue} from './is-shorthand-property-value.js';
|
|
46
|
-
export {default as isValueNotUsable} from './is-value-not-usable.js';
|
|
47
|
-
export {default as needsSemicolon} from './needs-semicolon.js';
|
|
48
|
-
export {checkVueTemplate} from './rule.js';
|
|
49
|
-
export {default as shouldAddParenthesesToAwaitExpressionArgument} from './should-add-parentheses-to-await-expression-argument.js';
|
|
50
|
-
export {default as shouldAddParenthesesToCallExpressionCallee} from './should-add-parentheses-to-call-expression-callee.js';
|
|
51
|
-
export {default as shouldAddParenthesesToConditionalExpressionChild} from './should-add-parentheses-to-conditional-expression-child.js';
|
|
52
|
-
export {default as shouldAddParenthesesToMemberExpressionObject} from './should-add-parentheses-to-member-expression-object.js';
|
|
53
|
-
export {default as shouldAddParenthesesToUnaryExpressionArgument} from './should-add-parentheses-to-unary-expression.js';
|
|
54
|
-
export {default as singular} from './singular.js';
|
|
55
|
-
export {default as toLocation} from './to-location.js';
|
|
56
|
-
export {default as getAncestor} from './get-ancestor.js';
|
|
57
|
-
export * from './string-cases.js';
|
|
58
|
-
export {getPreviousNode, getNextNode} from './get-sibling-node.js';
|
|
59
|
-
export {default as isNewExpressionWithParentheses} from './is-new-expression-with-parentheses.js';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {findVariable} from '@eslint-community/eslint-utils';
|
|
2
|
-
|
|
3
|
-
const getReferences = (scope, nodeOrName) => {
|
|
4
|
-
const {references = []} = findVariable(scope, nodeOrName) || {};
|
|
5
|
-
return references;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
Check if `this`, `arguments`, or the function name is used inside of itself.
|
|
10
|
-
|
|
11
|
-
@param {Node} functionNode - The function node.
|
|
12
|
-
@param {Scope} functionScope - The scope of the function node.
|
|
13
|
-
@returns {boolean}
|
|
14
|
-
*/
|
|
15
|
-
export default function isFunctionSelfUsedInside(functionNode, functionScope) {
|
|
16
|
-
/* c8 ignore next 3 */
|
|
17
|
-
if (functionScope.block !== functionNode) {
|
|
18
|
-
throw new Error('"functionScope" should be the scope of "functionNode".');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const {type, id} = functionNode;
|
|
22
|
-
if (type === 'ArrowFunctionExpression') {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (functionScope.thisFound) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (getReferences(functionScope, 'arguments').some(({from}) => from === functionScope)) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (id && getReferences(functionScope, id).length > 0) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return false;
|
|
39
|
-
}
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-left-hand-side.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const isLeftHandSide = node =>
|
|
2
|
-
(
|
|
3
|
-
(node.parent.type === 'AssignmentExpression' || node.parent.type === 'AssignmentPattern')
|
|
4
|
-
&& node.parent.left === node
|
|
5
|
-
)
|
|
6
|
-
|| (node.parent.type === 'UpdateExpression' && node.parent.argument === node)
|
|
7
|
-
|| (node.parent.type === 'ArrayPattern' && node.parent.elements.includes(node))
|
|
8
|
-
|| (
|
|
9
|
-
node.parent.type === 'Property'
|
|
10
|
-
&& node.parent.value === node
|
|
11
|
-
&& node.parent.parent.type === 'ObjectPattern'
|
|
12
|
-
&& node.parent.parent.properties.includes(node.parent)
|
|
13
|
-
)
|
|
14
|
-
|| (
|
|
15
|
-
node.parent.type === 'UnaryExpression'
|
|
16
|
-
&& node.parent.operator === 'delete'
|
|
17
|
-
&& node.parent.argument === node
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export default isLeftHandSide;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Check if the given node is a true logical expression or not.
|
|
3
|
-
|
|
4
|
-
The three binary expressions logical-or (`||`), logical-and (`&&`), and coalesce (`??`) are known as `ShortCircuitExpression`, but ESTree represents these by the `LogicalExpression` node type. This function rejects coalesce expressions of `LogicalExpression` node type.
|
|
5
|
-
|
|
6
|
-
@param {Node} node - The node to check.
|
|
7
|
-
@returns {boolean} `true` if the node is `&&` or `||`.
|
|
8
|
-
@see https://tc39.es/ecma262/#prod-ShortCircuitExpression
|
|
9
|
-
*/
|
|
10
|
-
const isLogicalExpression = node =>
|
|
11
|
-
node?.type === 'LogicalExpression'
|
|
12
|
-
&& (node.operator === '&&' || node.operator === '||');
|
|
13
|
-
|
|
14
|
-
export default isLogicalExpression;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {isOpeningParenToken, isClosingParenToken} from '@eslint-community/eslint-utils';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
@import {TSESTree as ESTree} from '@typescript-eslint/types';
|
|
5
|
-
@import * as ESLint from 'eslint';
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
Determine if a constructor function is newed-up with parens.
|
|
10
|
-
|
|
11
|
-
@param {ESTree.NewExpression} node - The `NewExpression` node to be checked.
|
|
12
|
-
@param {ESLint.Rule.RuleContext} context - The ESLint rule context object.
|
|
13
|
-
@returns {boolean} True if the constructor is called with parens.
|
|
14
|
-
|
|
15
|
-
Copied from https://github.com/eslint/eslint/blob/cc4871369645c3409dc56ded7a555af8a9f63d51/lib/rules/no-extra-parens.js#L252
|
|
16
|
-
*/
|
|
17
|
-
export default function isNewExpressionWithParentheses(node, context) {
|
|
18
|
-
if (node.arguments.length > 0) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const {sourceCode} = context;
|
|
23
|
-
const [penultimateToken, lastToken] = sourceCode.getLastTokens(node, 2);
|
|
24
|
-
// The expression should end with its own parens, for example, `new new Foo()` is not a new expression with parens.
|
|
25
|
-
return isOpeningParenToken(penultimateToken)
|
|
26
|
-
&& isClosingParenToken(lastToken)
|
|
27
|
-
&& sourceCode.getRange(node.callee)[1] < sourceCode.getRange(node)[1];
|
|
28
|
-
}
|
package/packages/config-eslint/node_modules/eslint-plugin-unicorn/rules/utils/is-node-matches.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Check if node matches object name or key path.
|
|
3
|
-
|
|
4
|
-
@param {Node} node - The AST node to check.
|
|
5
|
-
@param {string} nameOrPath - The object name or key path.
|
|
6
|
-
@returns {boolean}
|
|
7
|
-
*/
|
|
8
|
-
export function isNodeMatchesNameOrPath(node, nameOrPath) {
|
|
9
|
-
const names = nameOrPath.trim().split('.');
|
|
10
|
-
for (let index = names.length - 1; index >= 0; index--) {
|
|
11
|
-
const name = names[index];
|
|
12
|
-
if (!name) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (index === 0) {
|
|
17
|
-
return (
|
|
18
|
-
(node.type === 'Identifier' && node.name === name)
|
|
19
|
-
|| (name === 'this' && node.type === 'ThisExpression')
|
|
20
|
-
|| (name === 'super' && node.type === 'Super')
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
index === 1
|
|
26
|
-
&& node.type === 'MetaProperty'
|
|
27
|
-
&& node.property.type === 'Identifier'
|
|
28
|
-
&& node.property.name === name
|
|
29
|
-
) {
|
|
30
|
-
node = node.meta;
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
node.type === 'MemberExpression'
|
|
36
|
-
&& !node.optional
|
|
37
|
-
&& !node.computed
|
|
38
|
-
&& node.property.type === 'Identifier'
|
|
39
|
-
&& node.property.name === name
|
|
40
|
-
) {
|
|
41
|
-
node = node.object;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
Check if node matches any object name or key path.
|
|
51
|
-
|
|
52
|
-
@param {Node} node - The AST node to check.
|
|
53
|
-
@param {string[]} nameOrPaths - The object name or key paths.
|
|
54
|
-
@returns {boolean}
|
|
55
|
-
*/
|
|
56
|
-
export function isNodeMatches(node, nameOrPaths) {
|
|
57
|
-
return nameOrPaths.some(nameOrPath => isNodeMatchesNameOrPath(node, nameOrPath));
|
|
58
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {isUndefined} from '../ast/index.js';
|
|
2
|
-
|
|
3
|
-
// AST Types:
|
|
4
|
-
// https://github.com/eslint/espree/blob/master/lib/ast-node-types.js#L18
|
|
5
|
-
// Only types possible to be `callee` or `argument` are listed
|
|
6
|
-
const impossibleNodeTypes = new Set([
|
|
7
|
-
'ArrayExpression',
|
|
8
|
-
'ArrowFunctionExpression',
|
|
9
|
-
'ClassExpression',
|
|
10
|
-
'FunctionExpression',
|
|
11
|
-
'Literal',
|
|
12
|
-
'ObjectExpression',
|
|
13
|
-
'TemplateLiteral',
|
|
14
|
-
]);
|
|
15
|
-
|
|
16
|
-
const isNodeValueNotDomNode = node =>
|
|
17
|
-
impossibleNodeTypes.has(node.type)
|
|
18
|
-
|| isUndefined(node);
|
|
19
|
-
|
|
20
|
-
export default isNodeValueNotDomNode;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {isUndefined, isCallExpression, isMethodCall} from '../ast/index.js';
|
|
2
|
-
|
|
3
|
-
// AST Types:
|
|
4
|
-
// https://github.com/eslint/espree/blob/master/lib/ast-node-types.js#L18
|
|
5
|
-
// Only types possible to be `argument` are listed
|
|
6
|
-
const impossibleNodeTypes = new Set([
|
|
7
|
-
'ArrayExpression',
|
|
8
|
-
'BinaryExpression',
|
|
9
|
-
'ClassExpression',
|
|
10
|
-
'Literal',
|
|
11
|
-
'ObjectExpression',
|
|
12
|
-
'TemplateLiteral',
|
|
13
|
-
'UnaryExpression',
|
|
14
|
-
'UpdateExpression',
|
|
15
|
-
]);
|
|
16
|
-
|
|
17
|
-
// Technically these nodes could be a function, but most likely not
|
|
18
|
-
const mostLikelyNotNodeTypes = new Set([
|
|
19
|
-
'AssignmentExpression',
|
|
20
|
-
'AwaitExpression',
|
|
21
|
-
'NewExpression',
|
|
22
|
-
'TaggedTemplateExpression',
|
|
23
|
-
'ThisExpression',
|
|
24
|
-
]);
|
|
25
|
-
|
|
26
|
-
const isNodeValueNotFunction = node => (
|
|
27
|
-
impossibleNodeTypes.has(node.type)
|
|
28
|
-
|| mostLikelyNotNodeTypes.has(node.type)
|
|
29
|
-
|| isUndefined(node)
|
|
30
|
-
|| (
|
|
31
|
-
isCallExpression(node)
|
|
32
|
-
&& !(isMethodCall(node, {
|
|
33
|
-
method: 'bind',
|
|
34
|
-
optionalCall: false,
|
|
35
|
-
optionalMember: false,
|
|
36
|
-
}))
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
export default isNodeValueNotFunction;
|