Quick Fix

const value = user.prfile.name;
  • Rename to 'profile'Preferred
  • Add missing property 'prfile'
  • Disable rule for this line
About this piece

Quick Fix

Code line with a lightbulb quick-fix tile and a dropdown of fix options. Preferred fix gets an amber tag.

Usage

The import and the props worth knowing about, in one place.

import { Editor40 } from "@/components/beste/piece/editor40";

<Editor40
  line="const value = user.prfile.name;"
  actions={[
    {
      "label": "Rename to 'profile'",
      "preferred": true
    },
    {
      "label": "Add missing property 'prfile'"
    },
    {
      "label": "Disable rule for this line"
    }
  ]}
  bordered={false}
/>

More Editor pieces

View all Editor
const greet = (name: string) => `Hello, ${name}!`;
const user = { name: 'Nils' };
const msg = greet(user.name);
console.log(msg);
 
1// TODO migrate to server components
2// FIXME handles null state poorly
3// NOTE revisit once design lock lands
const users = load();
for (const user of users) {12×
render(user);
}
user.
  • idstring
  • namestring
  • emailstring
  • save(): Promise<void>
const name = user.prfile.name;Property 'prfile' does not exist on type 'User'.