Skip to content

Commit

Permalink
chore(examples/demo): add eslint.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sukvvon committed Dec 23, 2024
1 parent 3a5fe71 commit b30ccf4
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions examples/demo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import eslint from '@eslint/js'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

Check failure on line 4 in examples/demo/eslint.config.js

View workflow job for this annotation

GitHub Actions / lint

Unable to resolve path to module 'eslint-plugin-react-refresh'
import globals from 'globals'

export default [
{
ignores: ['dist'],
},
eslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.es2020,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
settings: {
react: {
version: '18.2',
},
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/prop-types': 'off',
'react/no-unknown-property': ['off'],
},
},
]

0 comments on commit b30ccf4

Please sign in to comment.