Skip to content

chore(lint): migrate to eslint flat config #2383

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

Merged
merged 1 commit into from
Mar 21, 2025
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
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import eslint from "@eslint/js";
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import eslintConfigPrettier from "eslint-config-prettier";

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
// tseslint.configs.recommendedTypeChecked, // Add type checks.
{
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.js'],
extends: [tseslint.configs.disableTypeChecked],
},
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
},
},
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
{
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
rules: {
'react/no-deprecated': 'warn',
'react/prop-types': 'off',
},
},
{
files: ['**/*.{jsx,tsx}'],
plugins: {
"react-refresh": reactRefresh,
},
rules: {
'react-refresh/only-export-components': 'warn',
},
},
eslintConfigPrettier, // Avoid conflict with prettier.
);
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
"dist/*"
],
"engines": {
"node": ">=18"
"node": ">=20.11"
},
"devDependencies": {
"@codemirror/lang-javascript": "^6.2.2",
"@commitlint/cli": "~17.8.0",
"@commitlint/config-conventional": "~17.8.0",
"@ebay/nice-modal-react": "~1.2.13",
"@eslint/js": "^9.18.0",
"@fortawesome/fontawesome-free": "~6.6.0",
"@rjsf/bootstrap-5": "https://github.com/nurikk/fileshare/blob/main/rjsf-bootstrap-5-4.2.0.tgz?raw=true",
"@rjsf/core": "~4.2.3",
Expand All @@ -60,8 +61,6 @@
"@types/react-transition-group": "~4.4.7",
"@types/reconnectingwebsocket": "~1.0.8",
"@types/ws": "~8.5.6",
"@typescript-eslint/eslint-plugin": "~6.7.4",
"@typescript-eslint/parser": "~6.7.4",
"@uiw/codemirror-theme-github": "^4.21.24",
"@uiw/react-codemirror": "^4.21.24",
"@vitejs/plugin-react": "~4.3.0",
Expand All @@ -77,14 +76,13 @@
"d3-zoom": "~3.0.0",
"deep-diff": "~1.0.2",
"deep-object-diff": "~1.1.9",
"eslint": "~8.57.0",
"eslint-config-prettier": "~9.1.0",
"eslint-config-react": "~1.1.7",
"eslint-plugin-prettier": "~5.0.0",
"eslint-plugin-react": "~7.33.2",
"eslint-plugin-react-refresh": "*",
"eslint": "~9.18.0",
"eslint-config-prettier": "~10.0.1",
"eslint-plugin-react": "~7.37.4",
"eslint-plugin-react-refresh": "~0.4.18",
"events": "~3.3.0",
"file-saver": "~2.0.5",
"globals": "~15.14.0",
"husky": "~8.0.3",
"i18next": "~23.5.1",
"i18next-browser-languagedetector": "~7.1.0",
Expand All @@ -93,7 +91,7 @@
"lodash": "~4.17.21",
"notyf": "~3.10.0",
"pinst": "~3.0.0",
"prettier": "~3.0.3",
"prettier": "~3.4.2",
"react": "~18.2.0",
"react-app-polyfill": "~3.0.0",
"react-bootstrap": "~2.10.0",
Expand All @@ -110,6 +108,7 @@
"store2": "^2.14.2",
"timeago.js": "~4.0.2",
"typescript": "~5.2.2",
"typescript-eslint": "^8.21.0",
"unistore": "~3.5.2",
"vite": "~4.5.0",
"vite-plugin-compression": "~0.5.1",
Expand Down
Loading
Loading