Skip to content

Files

Latest commit

 

History

History
41 lines (26 loc) · 1.06 KB

derived-has-same-inputs-outputs.md

File metadata and controls

41 lines (26 loc) · 1.06 KB

Pattern: Inconsistent variable and callback function names

Issue: -

Description

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, (b) => {});
derived(a, (b, set) => {});
derived([a, b], ([one, two]) => {});

🔧 Options

Nothing.

📚 Further Reading

🚀 Version

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

🔍 Implementation