diff --git a/packages/core/eslint-config/library.js b/packages/core/eslint-config/library.js index 4885d40d..058f4efd 100644 --- a/packages/core/eslint-config/library.js +++ b/packages/core/eslint-config/library.js @@ -34,6 +34,14 @@ module.exports = { }, ], 'no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], + 'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }], + 'import/no-cycle': [ + 'warn', + { + maxDepth: Infinity, + ignoreExternal: true, + }, + ], '@typescript-eslint/consistent-type-imports': 'warn', }, overrides: [ diff --git a/packages/core/eslint-config/next.js b/packages/core/eslint-config/next.js index 9fd41dda..76a8a76b 100644 --- a/packages/core/eslint-config/next.js +++ b/packages/core/eslint-config/next.js @@ -4,7 +4,13 @@ const project = resolve(process.cwd(), 'tsconfig.json'); /** @type {import("eslint").Linter.Config} */ module.exports = { - extends: ['eslint:recommended', 'prettier', require.resolve('@vercel/style-guide/eslint/next'), 'turbo'], + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'prettier', + require.resolve('@vercel/style-guide/eslint/next'), + 'turbo', + ], plugins: ['@typescript-eslint', 'only-warn', 'import'], globals: { React: true, @@ -35,10 +41,11 @@ module.exports = { }, ], 'no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], + 'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }], 'import/no-cycle': [ 'warn', { - maxDepth: 1, + maxDepth: Infinity, ignoreExternal: true, }, ], diff --git a/packages/core/eslint-config/package.json b/packages/core/eslint-config/package.json index f980f3d3..434e8149 100644 --- a/packages/core/eslint-config/package.json +++ b/packages/core/eslint-config/package.json @@ -15,6 +15,7 @@ "eslint-config-turbo": "^2.0.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-only-warn": "^1.1.0", + "eslint-plugin-react": "^7.34.3", "typescript": "^5.3.3" } } diff --git a/packages/core/eslint-config/react-internal.js b/packages/core/eslint-config/react-internal.js index 84aa5874..eb58b814 100644 --- a/packages/core/eslint-config/react-internal.js +++ b/packages/core/eslint-config/react-internal.js @@ -34,6 +34,14 @@ module.exports = { }, ], 'no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], + 'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }], + 'import/no-cycle': [ + 'warn', + { + maxDepth: Infinity, + ignoreExternal: true, + }, + ], '@typescript-eslint/consistent-type-imports': 'warn', }, overrides: [{ files: ['*.js?(x)', '*.ts?(x)'] }], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a236dfbd..a247e98f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: eslint-plugin-only-warn: specifier: ^1.1.0 version: 1.1.0 + eslint-plugin-react: + specifier: ^7.34.3 + version: 7.34.3(eslint@8.57.0) typescript: specifier: ^5.3.3 version: 5.4.5