From e7f8c2ed4e898774f94ab4d6c807960b0f542d10 Mon Sep 17 00:00:00 2001 From: capitnflam Date: Sat, 16 Mar 2024 01:40:14 +0100 Subject: [PATCH] feat: add eslint-plugin-security (#16) --- package-lock.json | 17 +++++++++++++++++ package.json | 1 + src/configs/recommended.ts | 1 + 3 files changed, 19 insertions(+) diff --git a/package-lock.json b/package-lock.json index 82a56a4..4f59ff5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "eslint-plugin-no-unsanitized": "4.0.2", "eslint-plugin-react": "7.34.1", "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-security": "2.1.1", "eslint-plugin-sonarjs": "0.24.0", "eslint-plugin-unicorn": "51.0.1", "eslint-plugin-xss": "0.1.12" @@ -3376,6 +3377,14 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-security": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-2.1.1.tgz", + "integrity": "sha512-7cspIGj7WTfR3EhaILzAPcfCo5R9FbeWvbgsPYWivSurTBKW88VQxtP3c4aWMG9Hz/GfJlJVdXEJ3c8LqS+u2w==", + "dependencies": { + "safe-regex": "^2.1.1" + } + }, "node_modules/eslint-plugin-sonarjs": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.24.0.tgz", @@ -9926,6 +9935,14 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/safe-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", + "dependencies": { + "regexp-tree": "~0.1.1" + } + }, "node_modules/safe-regex-test": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", diff --git a/package.json b/package.json index 80b7f09..2113149 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "eslint-plugin-no-unsanitized": "4.0.2", "eslint-plugin-react": "7.34.1", "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-security": "2.1.1", "eslint-plugin-sonarjs": "0.24.0", "eslint-plugin-unicorn": "51.0.1", "eslint-plugin-xss": "0.1.12" diff --git a/src/configs/recommended.ts b/src/configs/recommended.ts index 9181463..4ba1f67 100644 --- a/src/configs/recommended.ts +++ b/src/configs/recommended.ts @@ -10,6 +10,7 @@ export const recommended: ESLintConfig = { 'plugin:import/typescript', 'plugin:unicorn/recommended', 'plugin:sonarjs/recommended', + 'plugin:security/recommended-legacy', 'prettier', ], parser: '@typescript-eslint/parser',