Skip to content
#

ESLint

eslint logo

ESLint is an extensible static-analysis tool for JavaScript and related languages that helps catch errors before they break something in production.

Here are 8,004 public repositories matching this topic...

alvis
alvis commented Sep 24, 2021

What rule do you want to change?

max-lines-per-function

What change to do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

A new default behavior

Example code

/* eslint max-lines-per-function: ["error", {"max": 3}] */
export function bulkyFunction() {
  // line 1
  // line 2
  // line 3
}

Wha

bradzacher
bradzacher commented Nov 11, 2021

When we added syntax support for this with the TS4.4 support, we did not add proper support for scope analysis of this.

Currently scope analysis will "work" because the analyser will just traverse the block body - but it will create an incorrect scope tree because a new scope will not be created for the block scope created by the static block.

Repro

declare function someConditi

❄️ A React-Native Android iOS Starter App/ BoilerPlate / Example with Redux, RN Router, & Jest with the Snowflake Hapi Server running locally or on RedHat OpenShift for the backend, or a Parse Server running locally or remotely on Heroku

  • Updated Mar 7, 2019
  • JavaScript
leonheess
leonheess commented Aug 16, 2021

Please describe what the rule should do:
In Vue you can use test($event.detail) as well as event => test(event.detail) to achieve the same thing. 1. should be preferred.

  1. test($event.detail)
<Component
  @click="test($event.detail)"
/>
  1. event => test(event.detail)
<Component
  @click="event => test(event.detail)"
/>

**What category should

Created by Nicholas C. Zakas

Released June 2013

Latest release 8 days ago

Repository
eslint/eslint
Website
eslint.org

Related Topics

javascript linter linting