Skip to content

Commit

Permalink
Add(ESLint Config): eslint-plugin-react-hooks plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Dec 10, 2024
1 parent c39a5b6 commit ce437dc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 13 deletions.
18 changes: 10 additions & 8 deletions packages/eslint-config/configs/react.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const reactPlugin = require('eslint-plugin-react')
const reactHooksPlugin = require('eslint-plugin-react-hooks')
const react = require('eslint-plugin-react')
const reactHooks = require('eslint-plugin-react-hooks')
const reactRefresh = require('eslint-plugin-react-refresh')

/** @type {import('eslint').Linter.Config} */
module.exports = {
...reactPlugin.configs.flat.recommended,
...react.configs.flat.recommended,
rules: {
...reactPlugin.configs['jsx-runtime'].rules,
...reactHooksPlugin.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/display-name': 'off'
},
plugins: {
'react': reactPlugin,
'react-hooks': reactHooksPlugin,
'react': react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
files: ['**/*.{js,mjs,cjs,ts,cts,mts,jsx,mjsx,tsx,mtsx}'],
}
5 changes: 1 addition & 4 deletions packages/eslint-config/configs/stylistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ module.exports = {
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'semi': ['error', 'never']
},
files: [
'**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs',
'**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'
],
files: ['**/*.{js,mjs,cjs,ts,cts,mts,jsx,mjsx,tsx,mtsx}'],
}
3 changes: 2 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"eslint": "*",
"typescript": "*",
"eslint-plugin-react": "*",
"eslint-plugin-react-hooks": "*"
"eslint-plugin-react-hooks": "*",
"eslint-plugin-react-refresh": "*"
}
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vue-project/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"tsconfig.json": "tsconfig.*.json, env.d.ts",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}

0 comments on commit ce437dc

Please sign in to comment.