Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade ESLint to use new flat config #420

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import eslint from "@eslint/js";
import * as react from "eslint-plugin-react";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
settings: {
react: {
version: "detect",
},
},
plugins: {
react,
"@typescript-eslint": tseslint.plugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
"import/no-anonymous-default-export": "off",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}", "**/*.stories.*"],
},
);
50 changes: 1 addition & 49 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@types/react": "^18.0.29",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.0.1",
"eslint": "^8.43.0",
"msw": "^1.2.1",
"prettier": "^2.8.3",
"react": "^18.2.0",
Expand All @@ -50,54 +49,6 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"ignorePatterns": [
"dist/*",
"public/*",
"frontend/*"
],
"settings": {
"react": {
"version": "detect"
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:storybook/recommended",
"prettier"
],
"rules": {
"import/no-anonymous-default-export": "off",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
},
"overrides": [
{
"files": [
"**/*.stories.*"
]
}
]
},
"prettier": {
"overrides": [
{
Expand Down Expand Up @@ -142,6 +93,7 @@
"@storybook/theming": "^7.4.0",
"@storybook/types": "^7.4.0",
"babel-plugin-named-exports-order": "^0.0.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-storybook": "^0.6.12",
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const AppLayout = () => {
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const onPageResize = (props: any) => {
// eslint-disable-next-line react/prop-types
if (Object.hasOwn(props, "mobileView")) setIsMobileView(props.mobileView);
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5560,7 +5560,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==

eslint@^8.43.0:
eslint@^8.57.0:
version "8.57.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668"
integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==
Expand Down
Loading