update eslint to 9

This commit is contained in:
Timofei Iatsenko 2024-11-21 14:50:40 +01:00
parent a543bc0f73
commit 9f74b959c4
7 changed files with 1003 additions and 367 deletions

View File

@ -1,27 +0,0 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended"
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-redeclare": "off",
"no-labels": "off"
},
overrides: [
{
files: ["**/*.stories.*"],
rules: {
"import/no-anonymous-default-export": "off"
}
}
]
};

48
eslint.config.js Normal file
View File

@ -0,0 +1,48 @@
import typescriptEslint from "typescript-eslint";
import reactRefresh from "eslint-plugin-react-refresh";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
import js from "@eslint/js";
import storybook from "eslint-plugin-storybook";
export default typescriptEslint.config(
js.configs.recommended,
...typescriptEslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat["jsx-runtime"],
eslintConfigPrettier,
...storybook.configs["flat/recommended"],
{
ignores: ["dist/**", "public/**"],
},
{
plugins: {
"react-refresh": reactRefresh,
"react-hooks": reactHooks,
},
languageOptions: {
globals: {
...globals.browser,
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-redeclare": "off",
"no-labels": "off",
},
},
{
files: ["**/*.stories.*"],
rules: {
"import/no-anonymous-default-export": "off",
},
},
);

View File

@ -22,23 +22,29 @@
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.15.0",
"storybook": "^8.1.10", "storybook": "^8.1.10",
"@storybook/react": "^8.1.10", "@storybook/react": "^8.1.10",
"@storybook/react-vite": "^8.1.10", "@storybook/react-vite": "^8.1.10",
"@types/react": "^18.2.43", "@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17", "@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^6.14.0", "@typescript-eslint/parser": "^8.15.0",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0", "eslint": "^9.15.0",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-react": "^7.37.2",
"eslint-plugin-storybook": "^0.8.0", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.1",
"globals": "^15.12.0",
"prettier": "3.3.1", "prettier": "3.3.1",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"typescript-eslint": "^8.15.0",
"vite": "^5.0.8" "vite": "^5.0.8"
}, },
"engines": { "engines": {
"node": "^18.0.0 || >=20.0.0" "node": "^18.0.0 || >=20.0.0"
} },
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
} }

View File

@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/ban-types */ /* eslint-disable @typescript-eslint/no-empty-object-type */
import type { ExtendKcContext } from "keycloakify/login"; import type { ExtendKcContext } from "keycloakify/login";
import type { KcEnvName, ThemeName } from "../kc.gen"; import type { KcEnvName, ThemeName } from "../kc.gen";

View File

@ -2,6 +2,7 @@ import { i18nBuilder } from "keycloakify/login";
import type { ThemeName } from "../kc.gen"; import type { ThemeName } from "../kc.gen";
/** @see: https://docs.keycloakify.dev/i18n */ /** @see: https://docs.keycloakify.dev/i18n */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { useI18n, ofTypeI18n } = i18nBuilder.withThemeName<ThemeName>().build(); const { useI18n, ofTypeI18n } = i18nBuilder.withThemeName<ThemeName>().build();
type I18n = typeof ofTypeI18n; type I18n = typeof ofTypeI18n;

View File

@ -1,4 +1,3 @@
/* eslint-disable react-refresh/only-export-components */
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { StrictMode } from "react"; import { StrictMode } from "react";
import { KcPage } from "./kc.gen"; import { KcPage } from "./kc.gen";

1271
yarn.lock

File diff suppressed because it is too large Load Diff