From 0ffba062401060771650b675b214b4e90998e8ea Mon Sep 17 00:00:00 2001 From: Kevin Whitley Date: Wed, 31 May 2023 14:05:48 -0500 Subject: [PATCH 1/2] updating linting setup --- .eslintrc.js | 273 ----------------------- .eslintrc.json | 26 +++ .github/ISSUE_TEMPLATE/question.md | 15 ++ CODE-OF-CONDUCT.md => CODE_OF_CONDUCT.md | 0 package.json | 2 + src/Router.spec.ts | 19 +- src/StatusError.ts | 2 +- src/createCors.spec.ts | 17 +- src/createResponse.ts | 2 +- src/error.ts | 1 - src/withCookies.ts | 2 +- yarn.lock | 103 ++++++++- 12 files changed, 156 insertions(+), 306 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json rename CODE-OF-CONDUCT.md => CODE_OF_CONDUCT.md (100%) diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 577f6c48..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,273 +0,0 @@ -module.exports = { - 'env': { - 'browser': true, - 'es6': true, - 'commonjs': true, - 'es2020': true, - 'jest/globals': true, - 'node': true, - }, - 'parserOptions': { - 'ecmaVersion': 11, - 'sourceType': 'module', - }, - 'plugins': ['jest'], - 'rules': { - 'accessor-pairs': 'error', - 'array-bracket-newline': 'off', - 'array-bracket-spacing': 'off', - 'array-callback-return': 'error', - 'array-element-newline': 'off', - 'arrow-body-style': 'error', - 'arrow-parens': [ - 'error', - 'as-needed' - ], - 'arrow-spacing': [ - 'error', - { - 'after': true, - 'before': true - } - ], - 'block-scoped-var': 'error', - 'block-spacing': 'error', - 'callback-return': 'error', - 'camelcase': 'error', - 'class-methods-use-this': 'error', - 'comma-spacing': [ - 'error', - { - 'after': true, - 'before': false - } - ], - 'comma-style': [ - 'error', - 'last' - ], - 'complexity': 'error', - 'computed-property-spacing': [ - 'error', - 'never' - ], - 'consistent-return': 'off', - 'consistent-this': 'error', - 'curly': 'off', - 'default-case': 'error', - 'default-case-last': 'error', - 'default-param-last': 'error', - 'dot-location': [ - 'error', - 'property' - ], - 'dot-notation': 'error', - 'eol-last': [ - 'error', - 'always' - ], - 'eqeqeq': 'error', - 'func-call-spacing': 'error', - 'func-name-matching': 'error', - 'func-names': 'error', - 'function-paren-newline': 'error', - 'generator-star-spacing': 'error', - 'global-require': 'error', - 'grouped-accessor-pairs': 'error', - 'guard-for-in': 'error', - 'handle-callback-err': 'error', - 'id-blacklist': 'error', - 'id-match': 'error', - 'implicit-arrow-linebreak': 'off', - 'indent': 'off', - 'indent-legacy': 'off', - 'init-declarations': 'off', - 'jsx-quotes': 'error', - 'key-spacing': 'error', - 'keyword-spacing': [ - 'error', - { - 'after': true, - 'before': true - } - ], - 'linebreak-style': [ - 'error', - 'unix' - ], - 'lines-around-comment': 'error', - 'lines-around-directive': 'error', - 'lines-between-class-members': 'error', - 'max-classes-per-file': 'error', - 'max-depth': 'error', - 'max-len': 'off', - 'max-nested-callbacks': 'error', - 'max-params': 'error', - 'multiline-ternary': 'error', - 'new-parens': 'error', - 'newline-before-return': 'error', - 'newline-per-chained-call': 'error', - 'no-alert': 'error', - 'no-array-constructor': 'error', - 'no-await-in-loop': 'off', - 'no-bitwise': 'error', - 'no-buffer-constructor': 'error', - 'no-caller': 'error', - 'no-catch-shadow': 'error', - 'no-confusing-arrow': 'off', - 'no-console': 'off', - 'no-constructor-return': 'error', - 'no-continue': 'error', - 'no-div-regex': 'error', - 'no-duplicate-imports': 'error', - 'no-else-return': 'error', - 'no-eq-null': 'error', - 'no-eval': 'error', - 'no-extend-native': 'error', - 'no-extra-bind': 'error', - 'no-extra-label': 'error', - 'no-extra-parens': 'error', - 'no-floating-decimal': 'error', - 'no-implicit-coercion': 'error', - 'no-implicit-globals': 'off', - 'no-implied-eval': 'error', - 'no-invalid-this': 'error', - 'no-iterator': 'error', - 'no-label-var': 'error', - 'no-labels': 'error', - 'no-lone-blocks': 'error', - 'no-lonely-if': 'error', - 'no-loop-func': 'error', - 'no-loss-of-precision': 'error', - 'no-mixed-operators': 'error', - 'no-mixed-requires': 'error', - 'no-multi-assign': 'off', - 'no-multi-spaces': 'off', - 'no-multi-str': 'error', - 'no-multiple-empty-lines': 'error', - 'no-native-reassign': 'error', - 'no-negated-condition': 'off', - 'no-negated-in-lhs': 'error', - 'no-nested-ternary': 'off', - 'no-new': 'error', - 'no-new-func': 'error', - 'no-new-object': 'error', - 'no-new-require': 'error', - 'no-new-wrappers': 'error', - 'no-octal-escape': 'error', - 'no-param-reassign': 'off', - 'no-path-concat': 'error', - 'no-plusplus': 'error', - 'no-process-env': 'error', - 'no-process-exit': 'error', - 'no-proto': 'error', - 'no-restricted-exports': 'error', - 'no-restricted-globals': 'error', - 'no-restricted-imports': 'error', - 'no-restricted-modules': 'error', - 'no-restricted-properties': 'error', - 'no-restricted-syntax': 'error', - 'no-return-assign': [ - 'error', - 'except-parens' - ], - 'no-return-await': 'error', - 'no-script-url': 'error', - 'no-self-compare': 'error', - 'no-sequences': 'error', - 'no-spaced-func': 'error', - 'no-sync': 'error', - 'no-tabs': 'error', - 'no-template-curly-in-string': 'error', - 'no-ternary': 'off', - 'no-throw-literal': 'error', - 'no-trailing-spaces': 'error', - 'no-underscore-dangle': 'error', - 'no-unmodified-loop-condition': 'error', - 'no-unneeded-ternary': 'error', - 'no-unused-expressions': 'off', - 'no-use-before-define': 'error', - 'no-useless-backreference': 'error', - 'no-useless-call': 'error', - 'no-useless-computed-key': 'error', - 'no-useless-concat': 'error', - 'no-useless-constructor': 'error', - 'no-useless-rename': 'error', - 'no-useless-return': 'error', - 'no-var': 'error', - 'no-void': 'error', - 'no-warning-comments': 'error', - 'no-whitespace-before-property': 'error', - 'nonblock-statement-body-position': 'error', - 'object-curly-newline': 'error', - 'object-curly-spacing': [ - 'error', - 'always' - ], - 'object-shorthand': 'error', - 'one-var-declaration-per-line': 'off', - 'operator-assignment': 'error', - 'operator-linebreak': 'error', - 'padded-blocks': 'off', - 'padding-line-between-statements': 'error', - 'prefer-arrow-callback': 'error', - 'prefer-const': 'off', - 'prefer-destructuring': 'error', - 'prefer-exponentiation-operator': 'error', - 'prefer-named-capture-group': 'off', - 'prefer-numeric-literals': 'error', - 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', - 'prefer-reflect': 'error', - 'prefer-regex-literals': 'error', - 'prefer-rest-params': 'error', - 'prefer-spread': 'error', - 'prefer-template': 'error', - 'quote-props': 'off', - 'quotes': [ - 'error', - 'single' - ], - 'radix': 'error', - 'require-atomic-updates': 'error', - 'require-await': 'error', - 'require-unicode-regexp': 'off', - 'rest-spread-spacing': [ - 'error', - 'never' - ], - 'semi': ['error', 'never'], - 'semi-spacing': 'error', - 'semi-style': 'error', - 'sort-imports': 'error', - 'sort-vars': 'off', - 'space-before-blocks': 'error', - 'space-in-parens': [ - 'error', - 'never' - ], - 'space-infix-ops': 'off', - 'space-unary-ops': 'error', - 'spaced-comment': 'error', - 'strict': 'off', - 'switch-colon-spacing': 'error', - 'symbol-description': 'error', - 'template-curly-spacing': [ - 'error', - 'never' - ], - 'template-tag-spacing': 'error', - 'unicode-bom': [ - 'error', - 'never' - ], - 'valid-jsdoc': 'error', - 'wrap-iife': 'error', - 'wrap-regex': 'error', - 'yield-star-spacing': 'error', - 'yoda': [ - 'error', - 'never' - ] - } -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..cedd0f2b --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "overrides": [ + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "linebreak-style": ["error", "unix"], + "quotes": ["error", "single", { "allowTemplateLiterals": true }], + "semi": ["error", "never"], + "@typescript-eslint/no-explicit-any": "off" + } +} diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index e69de29b..3bec3ad8 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,15 @@ +--- +name: Question +about: Have a question or something to discuss? +title: '' +labels: '' +assignees: '' + +--- + +## Questions & Discussion +To cut down on long-standing topics that are discussion-based, rather than actual issues, please opt for one of the following paths, when possible. These have the benefit of potentially helping others after the issue (here) would have been closed. +1. [Create a Discussion Topic](https://github.com/kwhitley/itty-router/discussions/new/choose) +2. [Discuss on Discord](https://discord.com/channels/832353585802903572) + +Cheers! diff --git a/CODE-OF-CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from CODE-OF-CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/package.json b/package.json index d412b66a..3d1a72fd 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "@rollup/plugin-typescript": "^11.1.1", "@skypack/package-check": "^0.2.2", "@types/node": "^20.2.5", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", "@vitejs/plugin-vue": "^4.2.3", "@vitest/coverage-c8": "^0.31.3", "@whatwg-node/server": "^0.8.1", diff --git a/src/Router.spec.ts b/src/Router.spec.ts index b6407ca0..356aeb46 100644 --- a/src/Router.spec.ts +++ b/src/Router.spec.ts @@ -1,27 +1,12 @@ import 'isomorphic-fetch' import { describe, expect, it, vi } from 'vitest' import { buildRequest, createTestRunner, extract } from '../test-utils' -import { Router, Route, RouterType, RequestLike } from './Router' +import { Route, Router, RouterType } from './Router' const ERROR_MESSAGE = 'Error Message' const testRoutes = createTestRunner(Router) -type ALL = { - all: Route, -} - -type GET = { - get: Route, -} - -type PATCH = { - patch: Route, -} - -type POST = { - post: Route, -} describe('Router', () => { const router = Router() @@ -348,7 +333,6 @@ describe('Router', () => { it('can throw method not allowed error', async () => { const router = Router() - const errorText = 'Not Allowed' const okText = 'OK' const errorResponse = new Response(JSON.stringify({ foo: 'bar' }), { headers: { 'content-type': 'application/json;charset=UTF-8' }, @@ -390,7 +374,6 @@ describe('Router', () => { it('can easily create a ThrowableRouter', async () => { const error = (status, message) => new Response(message, { status }) - const errorResponse = err => error(err.status || 500, err.message) const ThrowableRouter = options => new Proxy(Router(options), { get: (obj, prop) => (...args) => diff --git a/src/StatusError.ts b/src/StatusError.ts index 22fa8bba..a715eaa1 100644 --- a/src/StatusError.ts +++ b/src/StatusError.ts @@ -7,7 +7,7 @@ export class StatusError extends Error { status: number [key: string]: any - constructor(status: number = 500, body?: StatusErrorObject | string) { + constructor(status = 500, body?: StatusErrorObject | string) { super(typeof body === 'object' ? body.error : body) typeof body === 'object' && Object.assign(this, body) this.status = status diff --git a/src/createCors.spec.ts b/src/createCors.spec.ts index efec2bf3..b8f71c55 100644 --- a/src/createCors.spec.ts +++ b/src/createCors.spec.ts @@ -14,7 +14,7 @@ describe('createCors(options)', () => { describe('options', () => { it('maxAge', async () => { - const { preflight, corsify } = createCors({ + const { preflight } = createCors({ maxAge: 60 }) const router = Router().all('*', preflight) @@ -27,7 +27,6 @@ describe('createCors(options)', () => { } }) const response = await router.handle(request) - const headers = Object.fromEntries(response.headers) expect(response.headers.get('Access-Control-Max-Age')).toBe('60') }) @@ -35,7 +34,7 @@ describe('createCors(options)', () => { describe('preflight (middleware)', () => { it('should handle options requests', async () => { - const { preflight, corsify } = createCors() + const { preflight } = createCors() const router = Router().all('*', preflight) const request = new Request('https://foo.bar', { method: 'OPTIONS', @@ -51,7 +50,7 @@ describe('createCors(options)', () => { }) it('should handle OPTIONS requests without standard headers via Allow (methods) header', async () => { - const { preflight, corsify } = createCors() + const { preflight } = createCors() const router = Router().all('*', preflight) const request = new Request('https://foo.bar', { method: 'OPTIONS' }) const response = await router.handle(request) @@ -68,10 +67,10 @@ describe('createCors(options)', () => { .all('*', preflight) .get('/foo', () => json(13)) const request = new Request('https://foo.bar/miss') - const response = await router - .handle(request) - .then(corsify) - .catch(catchError) + await router + .handle(request) + .then(corsify) + .catch(catchError) expect(catchError).toHaveBeenCalled() }) @@ -133,7 +132,7 @@ describe('createCors(options)', () => { }) describe('repeated use', () => { - const { preflight, corsify } = createCors() + const { preflight } = createCors() const router = Router().all('*', preflight) const origin = 'http://localhost:3000' diff --git a/src/createResponse.ts b/src/createResponse.ts index 02067d19..a7db7e81 100644 --- a/src/createResponse.ts +++ b/src/createResponse.ts @@ -10,7 +10,7 @@ type ResponseFormatterOptions = { headers?: object } & ResponseInit -export const createResponse = (format: string = 'text/plain; charset=utf-8', transform?: BodyTransformer): ResponseFormatter => +export const createResponse = (format = 'text/plain; charset=utf-8', transform?: BodyTransformer): ResponseFormatter => (body, options: ResponseFormatterOptions = {}) => { const { headers = {}, ...rest } = options diff --git a/src/error.ts b/src/error.ts index 3f185192..a237b72c 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,4 +1,3 @@ -import { IRequest } from 'Router' import { json } from './json' interface ErrorLike extends Error { diff --git a/src/withCookies.ts b/src/withCookies.ts index 03af42e6..9a14c5ed 100644 --- a/src/withCookies.ts +++ b/src/withCookies.ts @@ -9,5 +9,5 @@ export const withCookies = (r: IRequest): void => { r.cookies = (r.headers.get('Cookie') || '') .split(/;\s*/) .map((p: string): KVPair => p.split(/=(.+)/) as KVPair) - .reduce((a: CookieObject, [k, v]: KVPair) => (v ? (a[k] = v, a) : a), {}); + .reduce((a: CookieObject, [k, v]: KVPair) => (v ? (a[k] = v, a) : a), {}) } diff --git a/yarn.lock b/yarn.lock index 377641da..ab1dd1a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -651,6 +651,37 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.5.tgz#26d295f3570323b2837d322180dfbf1ba156fefb" integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ== +"@types/semver@^7.3.12": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + +"@typescript-eslint/eslint-plugin@^5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz#1e7a3e5318ece22251dfbc5c9c6feeb4793cc509" + integrity sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ== + dependencies: + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.59.8" + "@typescript-eslint/type-utils" "5.59.8" + "@typescript-eslint/utils" "5.59.8" + debug "^4.3.4" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.8.tgz#60cbb00671d86cf746044ab797900b1448188567" + integrity sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw== + dependencies: + "@typescript-eslint/scope-manager" "5.59.8" + "@typescript-eslint/types" "5.59.8" + "@typescript-eslint/typescript-estree" "5.59.8" + debug "^4.3.4" + "@typescript-eslint/scope-manager@5.16.0": version "5.16.0" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz" @@ -659,11 +690,34 @@ "@typescript-eslint/types" "5.16.0" "@typescript-eslint/visitor-keys" "5.16.0" +"@typescript-eslint/scope-manager@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz#ff4ad4fec6433647b817c4a7d4b4165d18ea2fa8" + integrity sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig== + dependencies: + "@typescript-eslint/types" "5.59.8" + "@typescript-eslint/visitor-keys" "5.59.8" + +"@typescript-eslint/type-utils@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz#aa6c029a9d7706d26bbd25eb4666398781df6ea2" + integrity sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA== + dependencies: + "@typescript-eslint/typescript-estree" "5.59.8" + "@typescript-eslint/utils" "5.59.8" + debug "^4.3.4" + tsutils "^3.21.0" + "@typescript-eslint/types@5.16.0": version "5.16.0" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.16.0.tgz" integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== +"@typescript-eslint/types@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.8.tgz#212e54414733618f5d0fd50b2da2717f630aebf8" + integrity sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w== + "@typescript-eslint/typescript-estree@5.16.0": version "5.16.0" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz" @@ -677,6 +731,33 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz#801a7b1766481629481b3b0878148bd7a1f345d7" + integrity sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg== + dependencies: + "@typescript-eslint/types" "5.59.8" + "@typescript-eslint/visitor-keys" "5.59.8" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.8.tgz#34d129f35a2134c67fdaf024941e8f96050dca2b" + integrity sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.59.8" + "@typescript-eslint/types" "5.59.8" + "@typescript-eslint/typescript-estree" "5.59.8" + eslint-scope "^5.1.1" + semver "^7.3.7" + "@typescript-eslint/utils@^5.10.0": version "5.16.0" resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.16.0.tgz" @@ -697,6 +778,14 @@ "@typescript-eslint/types" "5.16.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.59.8": + version "5.59.8" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz#aa6a7ef862add919401470c09e1609392ef3cc40" + integrity sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ== + dependencies: + "@typescript-eslint/types" "5.59.8" + eslint-visitor-keys "^3.3.0" + "@vitejs/plugin-vue@^4.2.3": version "4.2.3" resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz#ee0b6dfcc62fe65364e6395bf38fa2ba10bb44b6" @@ -2006,7 +2095,7 @@ globby@10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.4: +globby@^11.0.4, globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -2039,6 +2128,11 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + graphemer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" @@ -2792,6 +2886,11 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" @@ -3342,7 +3441,7 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2: +semver@^7.3.2, semver@^7.3.7: version "7.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== From ce8b0ff38adfe512099501fc9234018419c226ee Mon Sep 17 00:00:00 2001 From: Kevin Whitley Date: Wed, 31 May 2023 14:55:38 -0500 Subject: [PATCH 2/2] final eslint fixes anc cleaning up extra scripts --- .eslintrc.json | 9 ++- package.json | 7 +- src/Router.spec.ts | 14 ++-- yarn.lock | 198 +++++++++++++-------------------------------- 4 files changed, 66 insertions(+), 162 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index cedd0f2b..a5d491ff 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,8 +7,7 @@ "eslint:recommended", "plugin:@typescript-eslint/recommended" ], - "overrides": [ - ], + "overrides": [], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", @@ -18,9 +17,11 @@ "@typescript-eslint" ], "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", "linebreak-style": ["error", "unix"], + "prefer-const": "off", "quotes": ["error", "single", { "allowTemplateLiterals": true }], - "semi": ["error", "never"], - "@typescript-eslint/no-explicit-any": "off" + "semi": ["error", "never"] } } diff --git a/package.json b/package.json index 3d1a72fd..47b666d7 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,15 @@ "nested" ], "scripts": { + "dev": "yarn test", "lint": "npx eslint src", "test": "vitest --coverage --reporter verbose", "test:once": "vitest run", "coverage": "vitest run --coverage", "coveralls": "yarn coverage && cat ./coverage/lcov.info | coveralls", "verify": "echo 'verifying module...' && yarn build && yarn test:once", - "dev": "yarn test", "prerelease": "yarn verify", - "prebuild": "rimraf dist && mkdir dist", - "build:core": "rollup -c", - "build:extras": "rollup --config rollup.config.extras.mjs", + "prebuild": "rimraf dist && mkdir dist && yarn coverage && yarn lint", "build": "rollup -c", "release": "release --tag --push --patch --src=dist", "runtime:bun": "bun example/bun.ts", @@ -58,7 +56,6 @@ "@whatwg-node/server": "^0.8.1", "coveralls": "^3.1.1", "eslint": "^8.41.0", - "eslint-plugin-jest": "^27.2.1", "fetch-mock": "^9.11.0", "fs-extra": "^11.1.1", "globby": "^13.1.4", diff --git a/src/Router.spec.ts b/src/Router.spec.ts index 356aeb46..b6ab712a 100644 --- a/src/Router.spec.ts +++ b/src/Router.spec.ts @@ -1,7 +1,7 @@ import 'isomorphic-fetch' import { describe, expect, it, vi } from 'vitest' import { buildRequest, createTestRunner, extract } from '../test-utils' -import { Route, Router, RouterType } from './Router' +import { Router } from './Router' const ERROR_MESSAGE = 'Error Message' @@ -299,9 +299,9 @@ describe('Router', () => { it('stops at a handler that throws', async () => { const router = Router() - const handler1 = vi.fn(() => {}) + const handler1 = vi.fn() const handler2 = vi.fn(() => { throw new Error() }) - const handler3 = vi.fn(() => {}) + const handler3 = vi.fn() router.get('/foo', handler1, handler2, handler3) const escape = err => err @@ -408,11 +408,7 @@ describe('Router', () => { describe('.handle({ method = \'GET\', url }, ...args)', () => { it('passes extra args to each handler', async () => { - type GET = { - get: Route, - } - - const r = Router() as RouterType & GET + const r = Router() const h = (req, a, b) => { req.a = a; req.b = b } const originalA = 'A' const originalB = {} @@ -559,7 +555,7 @@ describe('ROUTE MATCHING', () => { { route: '/foo?', path: '/foo' }, { route: '/foo?', path: '/fo' }, { route: '/foo?', path: '/fooo', returns: false }, - { route: '/\.', path: '/', returns: false }, + { route: '/.', path: '/', returns: false }, { route: '/x|y', path: '/y', returns: true }, { route: '/x|y', path: '/x', returns: true }, { route: '/x/y|z', path: '/z', returns: true }, // should require second path as y or z diff --git a/yarn.lock b/yarn.lock index ab1dd1a3..3a871b2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -379,7 +379,7 @@ "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" - resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@isaacs/cliui@^8.0.2": @@ -682,14 +682,6 @@ "@typescript-eslint/typescript-estree" "5.59.8" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.16.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz" - integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== - dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" - "@typescript-eslint/scope-manager@5.59.8": version "5.59.8" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz#ff4ad4fec6433647b817c4a7d4b4165d18ea2fa8" @@ -708,29 +700,11 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.16.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.16.0.tgz" - integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== - "@typescript-eslint/types@5.59.8": version "5.59.8" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.8.tgz#212e54414733618f5d0fd50b2da2717f630aebf8" integrity sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w== -"@typescript-eslint/typescript-estree@5.16.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz" - integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== - dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.59.8": version "5.59.8" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz#801a7b1766481629481b3b0878148bd7a1f345d7" @@ -758,26 +732,6 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/utils@^5.10.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.16.0.tgz" - integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/typescript-estree" "5.16.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/visitor-keys@5.16.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz" - integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== - dependencies: - "@typescript-eslint/types" "5.16.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.59.8": version "5.59.8" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz#aa6a7ef862add919401470c09e1609392ef3cc40" @@ -893,7 +847,7 @@ acorn-walk@^8.1.1, acorn-walk@^8.2.0: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1, acorn@^8.8.2: +acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.2: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -903,11 +857,6 @@ acorn@^8.5.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== -acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== - agent-base@6: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" @@ -998,7 +947,7 @@ argparse@^1.0.7: argparse@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== array-union@^2.1.0: @@ -1142,7 +1091,7 @@ call-bind@^1.0.0, call-bind@^1.0.2: callsites@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== caniuse-lite@^1.0.30001400: @@ -1189,9 +1138,9 @@ chalk@^2.0.0, chalk@^2.4.1: supports-color "^5.3.0" chalk@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz" - integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1408,9 +1357,9 @@ deep-eql@^4.1.2: type-detect "^4.0.0" deep-is@^0.1.3: - version "0.1.3" - resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" @@ -1439,7 +1388,7 @@ dir-glob@^3.0.1: doctrine@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" @@ -1575,16 +1524,9 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: escape-string-regexp@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-jest@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz#b85b4adf41c682ea29f1f01c8b11ccc39b5c672c" - integrity sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg== - dependencies: - "@typescript-eslint/utils" "^5.10.0" - eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" @@ -1601,19 +1543,7 @@ eslint-scope@^7.2.0: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== - -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== @@ -1702,9 +1632,9 @@ estraverse@^4.1.1: integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz" - integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== estraverse@^5.2.0: version "5.2.0" @@ -1789,8 +1719,8 @@ fast-json-stable-stringify@^2.0.0: fast-levenshtein@^2.0.6: version "2.0.6" - resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fast-querystring@^1.1.1: version "1.1.1" @@ -1846,7 +1776,7 @@ figures@^3.0.0: file-entry-cache@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" @@ -1868,16 +1798,16 @@ find-up@^5.0.0: flat-cache@^3.0.4: version "3.0.4" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: flatted "^3.1.0" rimraf "^3.0.2" flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== foreground-child@^2.0.0: version "2.0.0" @@ -2095,7 +2025,7 @@ globby@10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.4, globby@^11.1.0: +globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -2285,17 +2215,9 @@ ignore@^5.2.0: resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== -import-fresh@^3.0.0: - version "3.2.1" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz" - integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-fresh@^3.2.1: +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" @@ -2303,8 +2225,8 @@ import-fresh@^3.2.1: imurmurhash@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== inflight@^1.0.4: version "1.0.6" @@ -2396,20 +2318,20 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" @@ -2562,7 +2484,7 @@ js-yaml@^3.13.1: js-yaml@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" @@ -2623,8 +2545,8 @@ json-schema@0.2.3: json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json-stringify-safe@~5.0.1: version "5.0.1" @@ -2679,7 +2601,7 @@ lcov-parse@^1.0.0: levn@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: prelude-ls "^1.2.1" @@ -2714,7 +2636,7 @@ lodash.isequal@^4.5.0: lodash.merge@^4.6.2: version "4.6.2" - resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash.sortby@^4.7.0: @@ -2893,8 +2815,8 @@ natural-compare-lite@^1.4.0: natural-compare@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== nice-try@^1.0.4: version "1.0.5" @@ -2999,7 +2921,7 @@ onetime@^5.1.0: optionator@^0.9.1: version "0.9.1" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: deep-is "^0.1.3" @@ -3037,7 +2959,7 @@ p-locate@^5.0.0: parent-module@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" @@ -3167,7 +3089,7 @@ postcss@^8.4.23: prelude-ls@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== pretty-bytes@^3.0.0: @@ -3304,7 +3226,7 @@ requires-port@^1.0.0: resolve-from@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve@^1.10.0, resolve@^1.22.1: @@ -3448,13 +3370,6 @@ semver@^7.3.2, semver@^7.3.7: dependencies: lru-cache "^6.0.0" -semver@^7.3.5: - version "7.3.5" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - serialize-javascript@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" @@ -3712,14 +3627,9 @@ strip-bom@^3.0.0: resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== -strip-json-comments@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz" - integrity sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w== - -strip-json-comments@^3.1.1: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== strip-literal@^1.0.1: @@ -3779,8 +3689,8 @@ test-exclude@^6.0.0: text-table@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== through@^2.3.6: version "2.3.8" @@ -3918,7 +3828,7 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: prelude-ls "^1.2.1" @@ -3935,7 +3845,7 @@ type-fest@^0.11.0: type-fest@^0.20.2: version "0.20.2" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== typescript@^5.0.4: @@ -4200,7 +4110,7 @@ why-is-node-running@^2.2.2: word-wrap@^1.2.3: version "1.2.3" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":