From 6554bc0ec850cd6faf7b3aaaa92ab06b43e86f12 Mon Sep 17 00:00:00 2001 From: nimratcoderabbit Date: Mon, 14 Jul 2025 13:13:21 -0400 Subject: [PATCH 1/2] Eslint showcase --- eslint/test.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 eslint/test.js diff --git a/eslint/test.js b/eslint/test.js new file mode 100644 index 0000000..733e0c1 --- /dev/null +++ b/eslint/test.js @@ -0,0 +1,7 @@ +const foo = 42 +let bar +console.log("Hello World") +if (foo == "42") { + console.log("Loose equality!") +} + From d6ca9bce83fda0781c406f1afc99aa11215375a7 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 Jul 2025 15:39:20 -0400 Subject: [PATCH 2/2] adding needed files for eslint --- eslint.config.mjs | 15 +++++++++++++++ eslint/test.js | 7 ------- package.json | 27 +++++++++++++++++++++++++++ sampleReact.jsx | 11 +++++++++++ 4 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 eslint.config.mjs delete mode 100644 eslint/test.js create mode 100644 package.json create mode 100644 sampleReact.jsx diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..2cac24b --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,15 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; +import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; +import { fixupConfigRules } from "@eslint/compat"; + + +export default [ + {files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]}, + { languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } }, + {languageOptions: { globals: globals.browser }}, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + ...fixupConfigRules(pluginReactConfig), +]; \ No newline at end of file diff --git a/eslint/test.js b/eslint/test.js deleted file mode 100644 index 733e0c1..0000000 --- a/eslint/test.js +++ /dev/null @@ -1,7 +0,0 @@ -const foo = 42 -let bar -console.log("Hello World") -if (foo == "42") { - console.log("Loose equality!") -} - diff --git a/package.json b/package.json new file mode 100644 index 0000000..d62753c --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "pr-reviewer_test", + "version": "0.0.0", + "main": "index.js", + "scripts": { + "test": "vitest run", + "test:watch": "vitest" + }, + "keywords": [], + "author": "", + "license": "UNLICENSED", + "description": "", + "devDependencies": { + "@eslint/compat": "^1.2.3", + "@eslint/js": "^9.15.0", + "eslint": "^9.15.0", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.12.0", + "react": "^19.0.0", + "stylelint": "^16.11.0", + "stylelint-config-standard": "^36.0.1", + "typescript": "^5.7.2", + "typescript-eslint": "8.16.0", + "vitest": "^3.0.4" + }, + "type": "module" +} diff --git a/sampleReact.jsx b/sampleReact.jsx new file mode 100644 index 0000000..f5a8c19 --- /dev/null +++ b/sampleReact.jsx @@ -0,0 +1,11 @@ +function TestComponent() { + // ruleid:react-dangerouslysetinnerhtml + return
; +} + +function OkComponent() { + // OK + const discordClientKey = '8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ'; + return {__html: 'Первый · Второй'}; +} +