Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

chore: enforce newline before return and after variable declarations #1107

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

danez
Copy link
Contributor

@danez danez commented Jun 9, 2022

Summary

As discussed in #1105, this new eslint rule enforces newlines before returns and after variable delcarations. I did not enable it for the tests, as that would change a lot.

Might be worth upstreaming this to the netlify eslint config?
The rule is already upstream but has no config https://github.com/netlify/eslint-config-node/blob/main/.eslintrc.cjs#L114 and according to the docs

This rule does nothing if no configurations are provided.

https://eslint.org/docs/rules/padding-line-between-statements

@danez danez added the type: chore work needed to keep the product and development running smoothly label Jun 9, 2022
@danez danez requested a review from a team June 9, 2022 16:15
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

⏱ Benchmark results

Comparing with 32a7387

largeDepsEsbuild: 7.8s

⬆️ 4.49% increase vs. 32a7387

^                                                                           9.3s                          
│                                                                           ┌──┐                          
│           8.3s                                                            |  |                          
│           ┌──┐            7.7s                                            |  |                    7.8s  
│           |  |            ┌──┐                                            |  |                    ┌──┐  
│           |  |            |  |                                            |  |                    |▒▒|  
│ ──────────┼──┼────6.4s────┼──┼────6.3s────6.6s────────────6.7s────6.4s────┼──┼────6.5s────6.4s────|▒▒|──
│   6.1s    |  |    ┌──┐    |  |    ┌──┐    ┌──┐    6.1s    ┌──┐    ┌──┐    |  |    ┌──┐    ┌──┐    |▒▒|  
│   ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsNft: 38.7s

⬆️ 3.66% increase vs. 32a7387

^                                                                          44.6s                          
│                                                                           ┌──┐                          
│          39.9s           40.5s                                            |  |                          
│           ┌──┐            ┌──┐                                            |  |                   38.7s  
│           |  |            |  |                                            |  |                    ┌──┐  
│           |  |            |  |                                            |  |                    |▒▒|  
│ ──────────┼──┼────────────┼──┼───────────30.7s────────────32s────30.5s────┼──┼───30.2s────31s─────|▒▒|──
│  28.1s    |  |    28s     |  |   29.1s    ┌──┐            ┌──┐    ┌──┐    |  |    ┌──┐    ┌──┐    |▒▒|  
│   ┌──┐    |  |    ┌──┐    |  |    ┌──┐    |  |   27.6s    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsZisi: 55.5s

⬇️ 1.37% decrease vs. 32a7387

^                                                                         1m 20.5s                        
│                                                                           ┌──┐                          
│                                                                           |  |                          
│                                                                           |  |                          
│                                                                 1m 2.9s   |  |          1m 3.2s         
│                                                                   ┌──┐    |  |  1m 2.2s   ┌──┐          
│          57.6s           58.3s                                    |  |    |  |    ┌──┐    |  |   55.5s  
│ ──────────┌──┐────────────┌──┐────────────────────────────────────┼──┼────┼──┼────┼──┼────┼──┼────┌──┐──
│           |  |            |  |            47s            48.3s    |  |    |  |    |  |    |  |    |▒▒|  
│  44.4s    |  |   44.1s    |  |   45.1s    ┌──┐   43.6s    ┌──┐    |  |    |  |    |  |    |  |    |▒▒|  
│   ┌──┐    |  |    ┌──┐    |  |    ┌──┐    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@eduardoboucas
Copy link
Member

Might be worth upstreaming this to the netlify eslint config?

Definitely! I would suggest opening a PR and adding an action item to the next developer tooling guild sync.

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍😍😍

@kodiakhq kodiakhq bot merged commit 14bf813 into main Jun 10, 2022
@kodiakhq kodiakhq bot deleted the eslint-rule-newline branch June 10, 2022 10:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants