Skip to content

Commit

Permalink
chore: add eslint-plugin-react
Browse files Browse the repository at this point in the history
  • Loading branch information
Aqours committed Dec 25, 2023
1 parent 854d47b commit 85f14c5
Show file tree
Hide file tree
Showing 6 changed files with 536 additions and 18 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ module.exports = {
ecmaVersion: 'latest',
sourceType: 'module',
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:vue/vue3-recommended', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:vue/vue3-recommended',
'prettier',
],
plugins: ['@typescript-eslint'],
rules: {
'no-undef': 'off',
Expand Down
2 changes: 1 addition & 1 deletion apps/react-demo/src/component/atom/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { memo } from 'react';
* @desc Pure React Component (Can reuse in other project)
* @desc React memo example
*/
export const Heading = memo(() => {
export const Heading = memo(function InHeading() {
// Check console message in devtool
console.log('[debug] Every component should be memoized and log once');
return <h2>Hello world! (Static Content)</h2>;
Expand Down
2 changes: 1 addition & 1 deletion apps/react-demo/src/component/mobx/MobxSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSubmitStore } from '../../store/app/submit.store';
/**
* @desc View with Store (Cannot reuse without same store)
*/
export const MobxSubmit = observer(() => {
export const MobxSubmit = observer(function InMobxSubmit() {
// App store (Mobx)
const submitStore = useSubmitStore();
const onClick = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/react-demo/src/component/mobx/MobxThemeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { observer } from 'mobx-react-lite';
import { useEffect } from 'react';
import { useThemeStore } from '../../store/global/theme.store';

export const MobxThemeSwitch = observer(() => {
export const MobxThemeSwitch = observer(function InMobxThemeSwitch() {
const themeStore = useThemeStore();

useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"dotenv": "16.3.1",
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-vue": "9.19.2",
"husky": "8.0.3",
"lint-staged": "15.0.2",
Expand Down
Loading

0 comments on commit 85f14c5

Please sign in to comment.