From 428a5cb49ea9c3f49c7b73709ad134bc8b43abf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Felipe=20Schulle?= Date: Thu, 27 Jun 2024 12:20:21 -0300 Subject: [PATCH] =?UTF-8?q?fix(react-config):=20ajustes=20nas=20configura?= =?UTF-8?q?=C3=A7=C3=B5es=20do=20react?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 45 +++++++++++++++++++++++--------------------- package.json | 2 +- src/presets/react.ts | 3 +++ 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 3bb8c24..5f37bb9 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,14 @@ create file eslint.config.js or EMS eslint.config.mjs in main project folder, ad ```js import { createConfig } from '@brainylab/eslint-config'; export default createConfig({ - configs: [ - /* your custom config */ - ], - presets: { - node: true, - typescript: true, - }, + configs: [ + /* your custom config */ + ], + presets: { + node: true, + typescript: true, + react: true, + }, }); ``` @@ -38,15 +39,17 @@ export default createConfig({ ```javascript import { presets } from '@brainylab/eslint-config/configs'; export default [ - [ - /* your custom config */ - ], - // using base config - ...presets.base, - // using typescript config - ...presets.typescript, - // using typescript config - ...presets.node, + [ + /* your custom config */ + ], + // using base config + ...presets.base, + // using typescript config + ...presets.typescript, + // using typescript config + ...presets.node, + // using react config + ...presets.react, ]; ``` @@ -63,12 +66,12 @@ create ou alter `.vscode/settings.json`. ```json { - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, - // eslint >= 8.56.0 and < 9 add line on VSCode - "eslint.experimental.useFlatConfig": true + // eslint >= 8.56.0 and < 9 add line on VSCode + "eslint.experimental.useFlatConfig": true } ``` diff --git a/package.json b/package.json index f897bd2..bc4aa34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brainylab/eslint-config", - "version": "2.4.1", + "version": "2.4.2", "description": "ESLint config for BrainyLab projects", "keywords": [ "eslint", diff --git a/src/presets/react.ts b/src/presets/react.ts index bf30267..f76bd76 100644 --- a/src/presets/react.ts +++ b/src/presets/react.ts @@ -24,7 +24,10 @@ export const react = [ }, rules: { ...pluginReact.configs.recommended.rules, + ...pluginReact.configs['jsx-runtime'].rules, ...pluginReactHook.configs.recommended.rules, + 'react/react-in-jsx-scope': 'off', + 'react/jsx-uses-react': 'off', }, }, ];