[//]: <> (--------------------------------------)
[//]: <> (......THIS FILE IS AUTOGENERATED......)
[//]: <> (--------------------------------------)
[//]: <> ( to update run: pnpm eslint.update    )
[//]: <> ( after changing the rule metadata on  )
[//]: <> ( packages/eslint-plugin-qwik/index.ts )
[//]: <> ( and update the frontmatter if needed )
[//]: <> (--------------------------------------)

# ESLint-Rules

Qwik comes with its own set of ESLint rules to help developers write better code.

    <span class="icon icon-inactive"></span>
    <b>Warn</b> in 'recommended' ruleset

    <span class="icon"></span>
    <b>Error</b> in 'recommended' ruleset

    <span class="icon icon-inactive"></span>
    <b>Warn</b> in 'strict' ruleset

    <span class="icon"></span>
    <b>Error</b> in 'strict' ruleset

## Possible Problems

These rules are available.

    <a href="#use-method-usage" class="p-4 flex panel">

        <code>use-method-usage</code>
        <span class="rule-description">Detect invalid use of use hooks.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#valid-lexical-scope" class="p-4 flex panel">

        <code>valid-lexical-scope</code>
        <span class="rule-description">Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#loader-location" class="p-4 flex panel">

        <code>loader-location</code>
        <span class="rule-description">Detect declaration location of loader$.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#no-react-props" class="p-4 flex panel">

        <code>no-react-props</code>
        <span class="rule-description">Disallow usage of React-specific `className`/`htmlFor` props.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#prefer-classlist" class="p-4 flex panel">

        <code>prefer-classlist</code>
        <span class="rule-description">Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#jsx-no-script-url" class="p-4 flex panel">

        <code>jsx-no-script-url</code>
        <span class="rule-description">Disallow javascript: URLs.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#jsx-key" class="p-4 flex panel">

        <code>jsx-key</code>
        <span class="rule-description">Disallow missing `key` props in iterators/collection literals</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#unused-server" class="p-4 flex panel">

        <code>unused-server</code>
        <span class="rule-description">Detect unused server$() functions.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#jsx-img" class="p-4 flex panel">

        <code>jsx-img</code>
        <span class="rule-description">For performance reasons, always provide width and height attributes for &lt;img&gt; elements, it will help to prevent layout shifts.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#jsx-a" class="p-4 flex panel">

        <code>jsx-a</code>
        <span class="rule-description">For a perfect SEO score, always provide href attribute for &lt;a&gt; elements.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

    <a href="#no-use-visible-task" class="p-4 flex panel">

        <code>no-use-visible-task</code>
        <span class="rule-description">Detect useVisibleTask$() functions.</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': true,
          }}
        >
          </span>

    </a>

    <a href="#serializer-signal-usage" class="p-4 flex panel">

        <code>serializer-signal-usage</code>
        <span class="rule-description">Ensure signals used in update() are also used in deserialize()</span>

        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>
        <span
          class={{
            'icon': false,
            'icon icon-inactive': false,
          }}
        >
          </span>

    </a>

## Details

### use-method-usage

      <span>Detect invalid use of use hooks.</span>

#### useWrongFunction

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {2} /component$/#a
export const Counter = component$(() => {
  const count = useSignal(0);
});
```

<span class="badge good">✓</span>
```tsx {2} /component$/#a
export const useCounter = () => {
  const count = useSignal(0);
  return count;
};
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {2} /component$/#a
export const Counter = (() => {
  const count = useSignal(0);
});
```
`use*` methods can only be used in `component$` functions or inside `use*` hooks (e.g. `useCounter`).

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/useMethodUsage.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### valid-lexical-scope

      <span>Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.</span>

#### referencesOutside

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {1,4} /print/#a /$((msg: string)/#b)
import { component$, useTask$, $ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  const print = $((msg: string) => {
    console.log(msg);
  });

  useTask$(() => {
    print("Hello World");
  });

  return <h1>Hello</h1>;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {1,4} /print/#a /(msg: string)/#b)
import { component$, useTask$ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  const print = (msg: string) => {
    console.log(msg);
  };

  useTask$(() => {
    print("Hello World");
  });

  return <h1>Hello</h1>;
});
```
Since Expressions are not serializable, they must be wrapped with `$( ... )` so that the optimizer can split the code into small chunks.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### invalidJsxDollar

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {1} /click/#a
import { component$, $ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  const click = $(() => console.log());
  return (
    <button onClick$={click}>log it</button>
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {1} /click/#a
import { component$ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  const click = () => console.log();
  return (
    <button onClick$={click}>log it</button>
  );
});
```
Event handler must be wrapped with `${ ... }`.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### mutableIdentifier

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {4} /person/#a
import { component$ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  const person = { name: 'Bob' };

  return (
    <button onClick$={() => {
      person.name = 'Alice';
    }}>
      {person.name}
    </button>
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {4} /personName/#a
import { component$ } from '@qwik.dev/core';

export const HelloWorld = component$(() => {
  let personName = 'Bob';

  return (
    <button onClick$={() => {
      personName = 'Alice';
    }}>
      {personName}
    </button>
  );
});
```
Simple values are not allowed to be mutated. Use an Object instead and edit one of its property.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### loader-location

      <span>Detect declaration location of loader$.</span>

#### invalidLoaderLocation

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {3} /routeLoader$/#a title="src/routes/product/[productId]/index.tsx"
import { routeLoader$ } from '@qwik.dev/router';

export const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {3} /routeLoader$/#a title="src/components/product/product.tsx"
import { routeLoader$ } from '@qwik.dev/router';

export const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```
This is not a valid location for a route loader. It only can be used inside the `src/routes` folder, in a `layout.tsx` or `index.tsx` file.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### missingExport

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {3} /export/#a
import { routeLoader$ } from '@qwik.dev/router';

export const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {3}
import { routeLoader$ } from '@qwik.dev/router';

const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```
The route loader function must be exported.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### wrongName

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {3} /use/#a
import { routeLoader$ } from '@qwik.dev/router';

export const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {3} /get/#a
import { routeLoader$ } from '@qwik.dev/router';

export const getProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```
The route loader function name must start with `use`.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### recommendedValue

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {3} /=>/#a
import { routeLoader$ } from '@qwik.dev/router';

export const useProductDetails = routeLoader$(async (requestEvent) => {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {9} /fetcher/#a
import { routeLoader$ } from '@qwik.dev/router';

async function fetcher() {
  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);
  const product = await res.json();
  return product as Product;
}

export const useProductDetails = routeLoader$(fetcher);
```
It is recommended to inline the arrow function. This will help the optimizer make sure that no server code is leaked to the client build.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### no-react-props

      <span>Disallow usage of React-specific `className`/`htmlFor` props.</span>

#### prefer

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx /class/#a /for/#b
<MyReactComponent class="foo" for="#password" />;
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx /className/#a /htmlFor/#b
<MyReactComponent className="foo" htmlFor="#password" />;
```
Prefer `class` and `for` props over `className` and `htmlFor`.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/noReactProps.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### prefer-classlist

      <span>Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.</span>

#### preferClasslist

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {7-10,15,16} /class/#a
import { component$ } from '@qwik.dev/core';
import styles from './MyComponent.module.css';

export default component$((props) => {
  // Array syntax example
  return <div class={[
    styles.container,
    'p-8',
    props.isHighAttention ? 'text-green-500' : 'text-slate-500',
    { active: true}
  ]}>Hello world</div>;

  // Object syntax example
  return <div class={{
    'text-green-500': props.isHighAttention,
    'p-4': true
  }}>Hello world</div>;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {2,7-13} /classnames/#a
import { component$ } from '@qwik.dev/core';
import classnames from 'classnames';
import styles from './MyComponent.module.css';

export default component$((props) => {
  return <div class={classnames(
    styles.container,
    'p-8',
    {
      'text-green-500' : props.isHighAttention,
      'text-slate-500' : !props.isHighAttention,
    },
    { active: true}
  )}>Hello world</div>;
});
```
The class prop should be used instead of any 3rd party lib to efficiently set classes based on an object.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/preferClasslist.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### jsx-no-script-url

      <span>Disallow javascript: URLs.</span>

#### noJSURL

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx
<button onClick$={() => alert('open the door please')}>ring</button>
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx /javascript:/#a
<button onClick$="javascript:alert('open the door please')">ring</button>
```

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxNoScriptUrl.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### jsx-key

      <span>Disallow missing `key` props in iterators/collection literals</span>

#### missingIterKey

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {13} /key=/#a
import { component$ } from '@qwik.dev/core';

export const Person = component$(() => {
  const person  = {
    firstName: 'John',
    lastName: 'Doe',
    age: 32,
  }

  return (
    <ul>
      {Object.keys(person).map((color) => (
        <li key={`person-${key}`}>{person[key]}</li>
      ))}
    </ul>
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {13}
import { component$ } from '@qwik.dev/core';

export const Person = component$(() => {
  const person  = {
    firstName: 'John',
    lastName: 'Doe',
    age: 32,
  }

  return (
    <ul>
      {Object.keys(person).map((color) => (
        <li>{person[key]}</li>
      ))}
    </ul>
  );
});
```
Missing `key` prop for element in iterator.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### missingIterKeyUsePrag

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {14} /Fragment/#a
import { component$ } from '@qwik.dev/core';
import Card from './Card';
import Summary from './Summary';

export const Person = component$(() => {
  const person  = {
    firstName: 'John',
    lastName: 'Doe',
    age: 32,
  }

  return (
    {Object.keys(person).map((color) => (
      <Fragment key={`person-${key}`}>
        <Card value={person[key]} />
        <Summary value={person[key]} />
      </Fragment>
    ))}
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {14}
import { component$ } from '@qwik.dev/core';
import Card from './Card';
import Summary from './Summary';

export const Person = component$(() => {
  const person  = {
    firstName: 'John',
    lastName: 'Doe',
    age: 32,
  }

  return (
    {Object.keys(person).map((color) => (
      < key={`person-${key}`}>
        <Card value={person[key]} />
        <Summary value={person[key]} />
      </>
    ))}
  );
});
```
Missing `key` prop for element in iterator. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `` instead

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### missingArrayKey

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {9} /key=/#a
import { component$ } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    <ul>
      {colors.map((color) => (
        <li key={`color-${color}`}>{color}</li>
      ))}
    </ul>
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {9}
import { component$ } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    <ul>
      {colors.map((color) => (
        <li>{color}</li>
      ))}
    </ul>
  );
});
```
Missing `key` prop for element in array. The key prop allows for improved rendering performance.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### missingArrayKeyUsePrag

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {8,11} /Fragment/#a
import { component$, Fragment } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    {colors.map((color) => (
      <Fragment key={`color-${color}`}>
        <h2>{color}</h2>
        <p>The color "${color}" is a great color.</p>
      </Fragment>
    ))}
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {8,11}
import { component$ } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    {colors.map((color) => (
      < key={`color-${color}`}>
        <h2>{color}</h2>
        <p>The color "${color}" is a great color.</p>
      </>
    ))}
  );
});
```
Missing `key` prop for element in array. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `` instead

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### nonUniqueKeys

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {9} /key=/#a
import { component$ } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    <ul>
      {colors.map((color) => (
        <li key={`color-${color}`}>{color}</li>
      ))}
    </ul>
  );
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {9} /key=/#a /not-a-good-idea/#b
import { component$ } from '@qwik.dev/core';

export const ColorList = component$(() => {
  const colors = ['red', 'green', 'blue'];

  return (
    <ul>
      {colors.map((color) => (
        <li key="not-a-good-idea">{color}</li>
      ))}
    </ul>
  );
});
```
The `key` prop must be unique.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### unused-server

      <span>Detect unused server$() functions.</span>

#### unusedServer

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx {4,12} /serverGreeter/#a
import { component$ } from '@qwik.dev/core';
import { server$ } from '@qwik.dev/router';

const serverGreeter = server$((firstName: string, lastName: string) => {
  const greeting = `Hello ${firstName} ${lastName}`;
  return greeting;
});

export default component$(() => (
  <button
    onClick$={async () => {
      const greeting = await serverGreeter('John', 'Doe');
      alert(greeting);
    }}
  >
    greet
  </button>
));
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx {4,12} /serverGreeter/#a
import { component$ } from '@qwik.dev/core';
import { server$ } from '@qwik.dev/router';

const serverGreeter = server$((firstName: string, lastName: string) => {
  const greeting = `Hello ${firstName} ${lastName}`;
  return greeting;
});

export default component$(() => (
  <button
    onClick$={async () => {
      const greeting = 'not using the server$ function';
      alert(greeting);
    }}
  >
    greet
  </button>
));
```
A `server$` function is declared, but never used.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/unusedServer.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### jsx-img

      <span>For performance reasons, always provide width and height attributes for &lt;img&gt; elements, it will help to prevent layout shifts.</span>

#### noLocalSrc

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx
import Image from '~/media/image.png';
<Image />
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx

```
Serving images from public are not optimized, nor cached. Import images using ESM instead.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxImg.ts" target="_blank" class="edit-btn">Edit examples</a></div>
#### noWidthHeight

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx /width/#a /height/#b

```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx

```
For performance reasons, always provide width and height attributes for `` elements, it will help to prevent layout shifts.

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxImg.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### jsx-a

      <span>For a perfect SEO score, always provide href attribute for &lt;a&gt; elements.</span>

#### noHref

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxA.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### no-use-visible-task

      <span>Detect useVisibleTask$() functions.</span>

#### noUseVisibleTask

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/noUseVisibleTask.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### serializer-signal-usage

      <span>Ensure signals used in update() are also used in deserialize()</span>

#### serializerSignalMismatch

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx /countSignal/#a
import { useSignal, useSerializer$ } from '@qwik.dev/core';
import MyClass from './my-class';

export default component$(() => {
  const countSignal = useSignal(0);

  useSerializer$(() => ({
    deserialize: () => new MyClass(countSignal.value),
    update: (myClass) => {
      myClass.count = countSignal.value;
      return myClass;
    }
  }));

  return <div>{myClass.count}</div>;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx /countSignal/#a
import { useSignal, useSerializer$ } from '@qwik.dev/core';
import MyClass from './my-class';

export default component$(() => {
  const countSignal = useSignal(0);

  useSerializer$(() => ({
    deserialize: (count) => new MyClass(count),
		initial: 2,
    update: (myClass) => {
      myClass.count = countSignal.value;
      return myClass;
    }
  }));

  return <div>{myClass.count}</div>;
});
```
The countSignal is used in update() but not in deserialize()

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/serializerSignalUsage.ts" target="_blank" class="edit-btn">Edit examples</a></div>

### serializer-signal-usage

      <span>Ensure signals used in update() are also used in deserialize()</span>

#### serializerSignalMismatch

Examples of correct code for this rule:

<span class="badge good">✓</span>
```tsx /countSignal/#a
import { useSignal, useSerializer$ } from '@qwik.dev/core';
import MyClass from './my-class';

export default component$(() => {
  const countSignal = useSignal(0);

  useSerializer$(() => ({
    deserialize: () => new MyClass(countSignal.value),
    update: (myClass) => {
      myClass.count = countSignal.value;
      return myClass;
    }
  }));

  return <div>{myClass.count}</div>;
});
```

Examples of incorrect code for this rule:

<span class="badge bad">✕</span>
```tsx /countSignal/#a
import { useSignal, useSerializer$ } from '@qwik.dev/core';
import MyClass from './my-class';

export default component$(() => {
  const countSignal = useSignal(0);

  useSerializer$(() => ({
    deserialize: (count) => new MyClass(count),
		initial: 2,
    update: (myClass) => {
      myClass.count = countSignal.value;
      return myClass;
    }
  }));

  return <div>{myClass.count}</div>;
});
```
The countSignal is used in update() but not in deserialize()

<div class="edit-examples-wrapper"><a href="https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/serializerSignalUsage.ts" target="_blank" class="edit-btn">Edit examples</a></div>
