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/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: 'Первый · Второй'}; +} +