![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
eslint-plugin-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 eslint-plugin-typescript-eslint-jsx-conditionals
yarn add -D eslint-plugin-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.
We found that eslint-plugin-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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.