disable '@typescript-eslint/prefer-nullish-coalescing' for primitive types

This commit is contained in:
Hazelnoot 2025-03-03 08:39:24 -05:00
parent 908271c995
commit 0cd1292308
2 changed files with 4 additions and 7 deletions

View file

@ -42,13 +42,6 @@ export default [
name: '__filename', name: '__filename',
message: 'Not in ESModule. Use `import.meta.url` instead.', message: 'Not in ESModule. Use `import.meta.url` instead.',
}], }],
// https://typescript-eslint.io/rules/prefer-nullish-coalescing/
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
ignorePrimitives: {
// Without this, the rule breaks for nullable booleans
boolean: true,
},
}],
}, },
}, },
{ {

View file

@ -37,6 +37,10 @@ export default [
'no-restricted-imports': ['error', { 'no-restricted-imports': ['error', {
paths: [{ name: 'punycode' }], paths: [{ name: 'punycode' }],
}], }],
// https://typescript-eslint.io/rules/prefer-nullish-coalescing/
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
ignorePrimitives: true,
}],
}, },
}, },
]; ];