Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change no-else-return config in .eslintrc.js #540

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jvolima
Copy link
Contributor

@jvolima jvolima commented Nov 30, 2023

'no-else-return': {
      allowElseIf: true,
}

Essa configuração no .eslintrc.js estava gerando uma exceção ao rodar o eslint, então após ler a documentação encontrei a solução para o problema:

'no-else-return': [
      2,
      {
        allowElseIf: true,
      },
],

O 2 configura que se for encontrado um código com um else após um return, vai gerar um erro no eslint e impedir um possível commit. E o allowElseIf vai permitir um else if após um if com return.

Copy link

vercel bot commented Nov 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
brasilapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2023 2:00am

Copy link

sonarcloud bot commented Nov 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

None yet

1 participant