diff --git a/.eslintrc.json b/.eslintrc.json index 15c242ebedf6a9..82e1bca232b86f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,7 @@ { "root": true, - "extends": ["@freecodecamp/eslint-config", "prettier", "prettier/react"], - "plugins": ["prettier", "react-hooks", "jsx-a11y"], + "extends": ["plugin:security/recommended","@freecodecamp/eslint-config", "prettier", "prettier/react"], + "plugins": ["security","prettier", "react-hooks", "jsx-a11y"], "rules": { "max-len": [ "error", diff --git a/package-lock.json b/package-lock.json index c61ed182fef6dd..3c6a71ec3c4a73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6518,6 +6518,15 @@ "integrity": "sha512-xir+3KHKo86AasxlCV8AHRtIZPHljqCRRUYgASkbatmt0fad4+5GgC7zkT7o/06hdKM6MIwp8giHVXqBPaarHQ==", "dev": true }, + "eslint-plugin-security": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz", + "integrity": "sha512-xlS7P2PLMXeqfhyf3NpqbvbnW04kN8M9NtmhpR3XGyOvt/vNKS7XPXT5EDbwKW9vCjWH4PpfQvgD/+JgN0VJKA==", + "dev": true, + "requires": { + "safe-regex": "^1.1.0" + } + }, "eslint-rule-composer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", diff --git a/package.json b/package.json index 545070c4bb623d..71a9fdaefd46a7 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "eslint-plugin-prettier": "^3.1.3", "eslint-plugin-react": "^7.19.0", "eslint-plugin-react-hooks": "^2.0.1", + "eslint-plugin-security": "^1.4.0", "execa": "^4.0.1", "faker": "^4.1.0", "gray-matter": "^4.0.2", diff --git a/tools/translation/translate-challenges.js b/tools/translation/translate-challenges.js index e4fd574da76f17..493b662fc9791d 100644 --- a/tools/translation/translate-challenges.js +++ b/tools/translation/translate-challenges.js @@ -123,7 +123,7 @@ function processFile( let transIndex = 0; testsArray.forEach((test, index) => { if (test.includes('- text')) { - testsArray[index] = ' - text: ' + translation[transIndex]; + testsArray[parseInt(index)] = ' - text: ' + translation[parseInt(transIndex)]; transIndex++; } });