Skip to content

Commit

Permalink
fix(react-config): ajustes nas configurações do react
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefelipeschulle committed Jun 27, 2024
1 parent 97b2d74 commit 428a5cb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});
```

Expand All @@ -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,
];
```

Expand All @@ -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
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brainylab/eslint-config",
"version": "2.4.1",
"version": "2.4.2",
"description": "ESLint config for BrainyLab projects",
"keywords": [
"eslint",
Expand Down
3 changes: 3 additions & 0 deletions src/presets/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
];

0 comments on commit 428a5cb

Please sign in to comment.