Skip to content

Commit 660dd9d

Browse files
authored
fix(eslint): deactivate react/no-leaked-conditional-rendering rule (#263)
This fix temporarily resolves the following issue: > Error while loading rule 'react/no-leaked-conditional-rendering': You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information. ## Summary by CodeRabbit - **Bug Fixes** - Disabled the ESLint rule for conditional rendering in React due to a temporary issue. - **Refactor** - Updated logging to use `console.info` for editor environment messages. - Adjusted internal configuration to include all TypeScript-related options in React settings. - **Style** - Allowed the use of `console.info` in addition to `warn` and `error` without triggering ESLint warnings.
1 parent 770aeff commit 660dd9d

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.changeset/fluffy-emus-burn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mheob/eslint-config': patch
3+
---
4+
5+
deactivate `react/no-leaked-conditional-rendering` rule for now; should be added again after the `parserOptions` issue is done

packages/eslint-config/src/configs/javascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function javascript(
5454
'no-class-assign': 'error',
5555
'no-compare-neg-zero': 'error',
5656
'no-cond-assign': ['error', 'always'],
57-
'no-console': ['warn', { allow: ['warn', 'error'] }],
57+
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
5858
'no-const-assign': 'error',
5959
'no-control-regex': 'error',
6060
'no-debugger': 'error',

packages/eslint-config/src/configs/react.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export async function react(
169169
'react/no-duplicate-key': 'warn',
170170
'react/no-forward-ref': 'warn',
171171
'react/no-implicit-key': 'warn',
172-
'react/no-leaked-conditional-rendering': 'warn',
172+
// 'react/no-leaked-conditional-rendering': 'warn', // deactivated because it is not working (parserOptions issue)
173173
'react/no-missing-key': 'error',
174174
'react/no-misused-capture-owner-stack': 'error',
175175
'react/no-nested-component-definitions': 'error',

packages/eslint-config/src/factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ export function mheob(
107107
if (isInEditor == null) {
108108
isInEditor = isInEditorEnv();
109109
if (isInEditor)
110-
// eslint-disable-next-line no-console
111-
console.log('[@mheob/eslint-config] Detected running in editor, some rules are disabled.');
110+
console.info('[@mheob/eslint-config] Detected running in editor, some rules are disabled.');
112111
}
113112

114113
const configs: Awaitable<TypedFlatConfigItem[]>[] = [];
@@ -182,6 +181,7 @@ export function mheob(
182181
if (options.react ?? false) {
183182
configs.push(
184183
react({
184+
...typescriptOptions,
185185
overrides: getOverrides(options, 'react'),
186186
tsconfigPath,
187187
}),

0 commit comments

Comments
 (0)