Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: enable strict-boolean-expressions #735

Open
Talent30 opened this issue Nov 9, 2023 · 0 comments
Open

Proposal: enable strict-boolean-expressions #735

Talent30 opened this issue Nov 9, 2023 · 0 comments

Comments

@Talent30
Copy link

Talent30 commented Nov 9, 2023

Rule: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md

Current:

		// TODO: Reconsider enabling it again in 2023.
		// NOTE: The rule was complete redone in typescript-eslint v3, so this config needs to be changed before this is enabled.
		// Disabled for now as it's too strict.
		// Relevant discussion: https://github.com/sindresorhus/refined-github/pull/2521#discussion_r343013852
		// '@typescript-eslint/strict-boolean-expressions': [
		// 	'error',
		// 	{
		// 		allowNullable: true,
		// 		allowSafe: true
		// 	}
		// ],

It has been redone.

Maybe it's time to enable it. Open for suggestions and discussion.

// Number is safe, string is safe, object is safe
    '@typescript-eslint/strict-boolean-expressions': [
      'error',
      {
        allowString: true,
        allowNumber: true,
        allowNullableObject: true,
      },
    ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant