diff --git a/widget/.eslintrc.json b/widget/.eslintrc.json index 7586d22a..8ff7e7ed 100644 --- a/widget/.eslintrc.json +++ b/widget/.eslintrc.json @@ -1,16 +1,14 @@ { - "plugins": [ - "@typescript-eslint/eslint-plugin", - "import", - "react", - "license-header" - ], + "root": true, + "plugins": ["@typescript-eslint", "import", "license-header"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", + "plugin:react/recommended", "plugin:react-hooks/recommended" ], "rules": { + "react/react-in-jsx-scope": "off", "@typescript-eslint/no-unused-vars": [ "error", { @@ -24,19 +22,17 @@ "error", { "groups": [ - "builtin", // Built-in imports (come from NodeJS native) go first - "external", // <- External imports - "unknown", // <- unknown - "index", // <- index imports - "internal", // <- Absolute imports - "parent", // <- Relative imports, the sibling and parent types they can be mingled together + "builtin", + "external", + "unknown", + "index", + "internal", + "parent", "sibling" ], "newlines-between": "always", "alphabetize": { - /* sort in ascending order. Options: ["ignore", "asc", "desc"] */ "order": "asc", - /* ignore case. Options: [true, false] */ "caseInsensitive": true } } @@ -50,8 +46,8 @@ "error", { "blankLine": "never", "prev": ["const"], "next": "const" } ], - "react/jsx-curly-brace-presence": "warn", - "react/self-closing-comp": "error", + "react/jsx-curly-brace-presence": ["warn"], + "react/self-closing-comp": ["error"], "license-header/header": [ "error", [ diff --git a/widget/.prettierrc b/widget/.prettierrc new file mode 100644 index 00000000..f3bcd4c9 --- /dev/null +++ b/widget/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": false, + "trailingComma": "all" +} diff --git a/widget/package.json b/widget/package.json index 0e84932c..8fac6ff7 100644 --- a/widget/package.json +++ b/widget/package.json @@ -34,6 +34,7 @@ "@typescript-eslint/parser": "^7.15.0", "@vitejs/plugin-react": "^4.3.1", "eslint": "^8.57.0", + "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", "sass": "^1.77.8",