From 39112ad5cbc7e9a0b6af169d01881e2c12701e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Felipe=20Schulle?= Date: Thu, 27 Jun 2024 14:40:44 -0300 Subject: [PATCH] fix(next): ajustes no config do next --- README.md | 3 +++ eslint.config.js | 2 +- package.json | 2 +- src/create-config.ts | 2 +- src/presets/next.ts | 2 +- src/presets/react.ts | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5f37bb9..c94b3a2 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ export default createConfig({ node: true, typescript: true, react: true, + next: true, }, }); ``` @@ -50,6 +51,8 @@ export default [ ...presets.node, // using react config ...presets.react, + // using react config + ...presets.next, ]; ``` diff --git a/eslint.config.js b/eslint.config.js index 1b95821..b830a20 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,3 +1,3 @@ import { presets } from './dist/index.js'; -export default [...presets.base, ...presets.typescript]; +export default [...presets.base, ...presets.typescript,...presets.react, ...presets.next]; diff --git a/package.json b/package.json index cf98f3f..6a1509d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brainylab/eslint-config", - "version": "2.5.0", + "version": "2.5.1", "description": "ESLint config for BrainyLab projects", "keywords": [ "eslint", diff --git a/src/create-config.ts b/src/create-config.ts index 1eefb30..86621f3 100644 --- a/src/create-config.ts +++ b/src/create-config.ts @@ -27,7 +27,7 @@ export function createConfig(params: ConfigParams): FlatESLintConfig[] { configs.push(...node); } - if (params.presets?.react) { + if (params.presets?.react || params.presets?.next) { configs.push(...react); } diff --git a/src/presets/next.ts b/src/presets/next.ts index 0e3d641..b05f93b 100644 --- a/src/presets/next.ts +++ b/src/presets/next.ts @@ -7,7 +7,7 @@ export const next = [ }, rules: { ...pluginNext.configs.recommended.rules, - 'react/no-unknown-property': ['error', { ignore: ['tw'] }], + '@next/next/no-html-link-for-pages': 'off', }, }, ]; diff --git a/src/presets/react.ts b/src/presets/react.ts index 42f3a16..632b94c 100644 --- a/src/presets/react.ts +++ b/src/presets/react.ts @@ -29,6 +29,7 @@ export const react = [ 'react/react-in-jsx-scope': 'off', 'react/jsx-uses-react': 'off', 'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }], + 'react/no-unknown-property': ['error', { ignore: ['tw'] }], }, }, ];