Skip to content

Conversation

@archmoj
Copy link
Contributor

@archmoj archmoj commented Apr 18, 2019

A follow up of #3162, #3162 (comment) and the discussion with @etpinard concerning redundant and sometime confusing function names this PR adds a new lint rule to disallow extra function names when they are not required. Image below illustrates one example where the function is named put and exported as get.

Sieve.prototype.get = function put(position, value) {

Screenshot from 2019-04-18 16-38-50

@plotly/plotly_js

@etpinard
Copy link
Contributor

Ah ooops. I think I might have unestimated what adding this new rule meant this morning (in-person convo)

I very much dislike removing the function names from things we export off module.exports e.g.:

image

@etpinard
Copy link
Contributor

@archmoj maybe https://eslint.org/docs/rules/func-name-matching would give better results.

@archmoj
Copy link
Contributor Author

archmoj commented Apr 19, 2019

@archmoj maybe https://eslint.org/docs/rules/func-name-matching would give better results.

Awesome! That one was able to detect the mismatches: 6d1609a.

@etpinard
Copy link
Contributor

Ok. Nicely done 💃

@archmoj archmoj merged commit 36b4773 into master Apr 22, 2019
@archmoj archmoj deleted the eslint-name-functions branch April 22, 2019 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants