Skip to content

Commit

Permalink
chore(examples/demo/eslint): migrate eslint configuration .eslintrc.c…
Browse files Browse the repository at this point in the history
…js to eslint.config.js
  • Loading branch information
sukvvon committed Dec 18, 2024
1 parent 437a2fa commit e9f53b7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
16 changes: 0 additions & 16 deletions examples/demo/.eslintrc.cjs

This file was deleted.

36 changes: 36 additions & 0 deletions examples/demo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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'

export default [
eslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
languageOptions: {
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 e9f53b7

Please sign in to comment.