/** * Enforce that React Router route `element` values are JSX, not component references. * * Example (good): * { path: "/x", element: } * * Example (bad): * { path: "/x", element: Page } */ export default { rules: { 'route-element-jsx': { meta: { type: 'problem', docs: { description: 'Require RouteObject.element to be JSX (e.g. ), not a component reference.', }, schema: [], messages: { mustBeJsx: '`element` must be JSX (e.g. `<{{name}} />`). You likely meant to render the component, not pass it.', }, }, create(context) { const sourceCode = context.sourceCode function getKeyName(key) { if (!key) return null if (key.type === 'Identifier') return key.name if (key.type === 'Literal') return String(key.value) return null } function isJsxLike(node) { if (!node) return false switch (node.type) { case 'JSXElement': case 'JSXFragment': return true case 'Literal': // allow null for "no element" return node.value === null case 'ConditionalExpression': return isJsxLike(node.consequent) && isJsxLike(node.alternate) case 'LogicalExpression': // e.g. condition && return isJsxLike(node.right) case 'CallExpression': { // allow React.createElement(...) const callee = node.callee return ( callee?.type === 'MemberExpression' && callee.object?.type === 'Identifier' && callee.object.name === 'React' && callee.property?.type === 'Identifier' && callee.property.name === 'createElement' ) } default: return false } } function getSuggestedName(node) { if (!node) return 'Component' if (node.type === 'Identifier') return node.name if (node.type === 'MemberExpression') { return sourceCode.getText(node) } return 'Component' } return { Property(node) { const keyName = getKeyName(node.key) if (keyName !== 'element') return if (node.computed) return // Only report when it's clearly not JSX-like (to avoid false positives). if (isJsxLike(node.value)) return // Common "wrong" pattern: Identifier / MemberExpression / LazyExoticComponent variable, etc. const suggested = getSuggestedName(node.value) context.report({ node: node.value, messageId: 'mustBeJsx', data: { name: suggested }, }) }, } }, }, }, }
top of page

Privacy Policy

A legal disclaimer

The explanations and information provided on this page are only general and high-level explanations and information on how to write your own document of a Privacy Policy. You should not rely on this article as legal advice or as recommendations regarding what you should actually do, because we cannot know in advance what are the specific privacy policies you wish to establish between your business and your customers and visitors. We recommend that you seek legal advice to help you understand and to assist you in the creation of your own Privacy Policy.

Privacy Policy - the basics

Having said that, a privacy policy is a statement that discloses some or all of the ways a website collects, uses, discloses, processes, and manages the data of its visitors and customers. It usually also includes a statement regarding the website’s commitment to protecting its visitors’ or customers’ privacy, and an explanation about the different mechanisms the website is implementing in order to protect privacy. 

 

Different jurisdictions have different legal obligations of what must be included in a Privacy Policy. You are responsible to make sure you are following the relevant legislation to your activities and location. 

What to include in the Privacy Policy

Generally speaking, a Privacy Policy often addresses these types of issues: the types of information the website is collecting and the manner in which it collects the data; an explanation about why is the website collecting these types of information; what are the website’s practices on sharing the information with third parties; ways in which your visitors and customers can exercise their rights according to the relevant privacy legislation; the specific practices regarding minors’ data collection; and much, much more. 


To learn more about this, check out our article “Creating a Privacy Policy”.

bottom of page