# svelte/derived-has-same-inputs-outputs

derived store should use same variable names between values and callback

# πŸ“– Rule Details

This rule reports where variable names and callback function’s argument names are different. This is mainly a recommended rule to avoid implementation confusion.

/* eslint svelte/derived-has-same-inputs-outputs: "error" */

import { derived } from 'svelte/store';

/* βœ“ GOOD */
derived(a, ($a) => {});
derived(a, ($a, set) => {});
derived([a, b], ([$a, $b]) => {});

/* βœ— BAD */
derived(a, (
The argument name should be '$a'. (svelte/derived-has-same-inputs-outputs)
b
) => {});
derived(a, (
The argument name should be '$a'. (svelte/derived-has-same-inputs-outputs)
b
, set) => {});
derived([a, b], ([
The argument name should be '$a'. (svelte/derived-has-same-inputs-outputs)
one
The argument name should be '$b'. (svelte/derived-has-same-inputs-outputs)
, two]) => {});

# πŸ”§ Options

Nothing.

# πŸ“š Further Reading

# πŸš€ Version

This rule was introduced in eslint-plugin-svelte v2.8.0

# πŸ” Implementation