From 507cf43e8286c349d0a210aab3529113bec8970b Mon Sep 17 00:00:00 2001 From: FabianLars Date: Wed, 3 May 2023 09:32:30 +0200 Subject: [PATCH] chore: fix lint issues --- .eslintignore | 3 ++- .eslintrc.json | 3 ++- package.json | 1 + plugins/log/guest-js/index.ts | 3 ++- pnpm-lock.yaml | 20 ++++++++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.eslintignore b/.eslintignore index 2c6d35b6..1c120ff5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ target node_modules -dist \ No newline at end of file +dist +dist-js diff --git a/.eslintrc.json b/.eslintrc.json index 4cc47de1..96b58264 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,8 @@ "extends": [ "prettier", "eslint:recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "plugin:security/recommended" ], "overrides": [], "parser": "@typescript-eslint/parser", diff --git a/package.json b/package.json index 30c223ed..5a0bfce4 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "eslint-plugin-import": "^2.27.5", "eslint-plugin-n": "^15.7.0", "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-security": "^1.7.1", "prettier": "^2.8.7", "rollup": "^3.20.4", "typescript": "^5.0.4" diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index f421b7bc..4fb4b0c9 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -189,7 +189,8 @@ export async function attachConsole(): Promise { // Strip ANSI escape codes const message = payload.message.replace( - // eslint-disable-next-line no-control-regex + // TODO: Investigate security/detect-unsafe-regex + // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "" ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a4cdc08a..50c1bf1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,6 +37,9 @@ importers: eslint-plugin-promise: specifier: ^6.1.1 version: 6.1.1(eslint@8.38.0) + eslint-plugin-security: + specifier: ^1.7.1 + version: 1.7.1 prettier: specifier: ^2.8.7 version: 2.8.7 @@ -1449,6 +1452,12 @@ packages: eslint: 8.38.0 dev: true + /eslint-plugin-security@1.7.1: + resolution: {integrity: sha512-sMStceig8AFglhhT2LqlU5r+/fn9OwsA72O5bBuQVTssPCdQAOQzL+oMn/ZcpeUY6KcNfLJArgcrsSULNjYYdQ==} + dependencies: + safe-regex: 2.1.1 + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -2293,6 +2302,11 @@ packages: picomatch: 2.3.1 dev: true + /regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + dev: true + /regexp.prototype.flags@1.4.3: resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} engines: {node: '>= 0.4'} @@ -2373,6 +2387,12 @@ packages: is-regex: 1.1.4 dev: true + /safe-regex@2.1.1: + resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} + dependencies: + regexp-tree: 0.1.27 + dev: true + /sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} dependencies: