
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
typescript-eslint-jsx-conditionals
Advanced tools
TypeScript ESlint rule to remove unsafe conditionals in JSX.
TypeScript ESLint rule to remove unsafe conditionals in JSX.
npm install --save-dev typescript-eslint-jsx-conditionals
yarn add -D typescript-eslint-jsx-conditionals
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'typescript-eslint-jsx-conditionals'],
ignorePatterns: ['.eslintrc.js'],
rules: {
'typescript-eslint-jsx-conditionals/strict-jsx-conditionals': 'error',
},
}
const Component = ({ check }: { check: boolean }) => {
return <div>{check && <p>Check</p>}</div>
}
const HelloWorld = () => {
const someCondition = true
return <div>{someCondition && <p>Check</p>}</div>
}
Check might be undefined.
const Component = ({ check }: { check?: boolean }) => {
return <div>{check && <p>Check</p>}</div>
}
message.length is a number
const HelloWorld = () => {
const message = 'hello world'
return <div>{message.length && <p>Check</p>}</div>
}
Check might not be a boolean
const Component = ({ check }: { check: boolean | string | null }) => {
return <div>{check && <p>Check</p>}</div>
}
Name | Type | Default Value | Description |
---|---|---|---|
preferBoolean | boolean | false | When using auto-fix, use Boolean() cast instead of !! |
normalize | boolean | false | ensure that your whole codebase uses the same type of casting - HIGHLY EXPERIMENTAL and NOT recommended |
FAQs
TypeScript ESlint rule to remove unsafe conditionals in JSX.
The npm package typescript-eslint-jsx-conditionals receives a total of 0 weekly downloads. As such, typescript-eslint-jsx-conditionals popularity was classified as not popular.
We found that typescript-eslint-jsx-conditionals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.