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

Switch to eslint flat config #99

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 0 additions & 32 deletions .eslintrc

This file was deleted.

39 changes: 39 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import js from '@eslint/js';
import google from 'eslint-config-google';
import react from 'eslint-plugin-react/configs/recommended.js';
import reactJSXRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';

export default [
{ignores: ['dist/']},
js.configs.recommended,
google,
react,
reactJSXRuntime,
{
languageOptions: {
globals: {
...globals.browser,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
settings: {
react: {
version: 'detect',
},
},
files: [
'**/*.js',
'**/*.jsx',
],
rules: {
...reactHooks.configs.recommended.rules,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...reactHooks.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 'warn',

Since we're no longer 'including', need to manually add this rule in

'max-len': ['error', {'code': 120}],
},
},
];