Skip to content

Instantly share code, notes, and snippets.

View barrymcgee's full-sized avatar
🏠
Working from home

Barry McGee barrymcgee

🏠
Working from home
View GitHub Profile
@barrymcgee
barrymcgee / jsx-no-logical-and.js
Created May 1, 2024 10:12
Custom Eslint rule - no logical and
const reportMessage =
"Don't use logical && expressions to conditionally render JSX as variables returning as NaN, 0 or an empty string will crash a React Native app."
/**
* @type {eslint.Rule.RuleModule}
*/
module.exports = {
meta: {
type: 'problem',
docs: {
let net = new brain.NeuralNetwork();
net.train([{
Input: { r: 0.03, g: 0.7, b: 0.5 },
Output: { black: 1 }
},{
Input: { r: 0.16, g: 0.09, b: 0.2 },
Output: { black: 1 }
},{
Input: { r: 0.5, b: 0.5 },