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

ESLint error on roles param in JS project #5101

Closed
skiabox opened this issue Apr 9, 2022 · 3 comments · Fixed by #6037
Closed

ESLint error on roles param in JS project #5101

skiabox opened this issue Apr 9, 2022 · 3 comments · Fixed by #6037
Labels
bug/confirmed We have confirmed this is a bug good first issue help wanted topic/crwa create-redwood-app

Comments

@skiabox
Copy link

skiabox commented Apr 9, 2022

Eslint error inside api/src/lib/auth.js

--> 'roles' is defined but never used

@jtoar jtoar added this to Triage Apr 9, 2022
@jtoar jtoar moved this to Needs triage in Triage Apr 9, 2022
@simoncrypta
Copy link
Collaborator

Hi @skiabox and welcome to RedwoodJS. 😄

I cannot reproduce this Eslint error. Is it while doing the tutorial ? If not, more context about how you use roles will help us.

Thanks !

@simoncrypta simoncrypta added the bug/needs-info More information is needed for reproduction label Apr 9, 2022
@simoncrypta simoncrypta moved this from Needs triage to Needs confirmation in Triage Apr 9, 2022
@jtoar jtoar added this to Main May 5, 2022
@jtoar jtoar moved this to Backlog in Main May 5, 2022
@jtoar jtoar moved this from Backlog to Triage in Main May 8, 2022
@jtoar jtoar removed this from Triage May 8, 2022
@jtoar
Copy link
Contributor

jtoar commented May 11, 2022

In TS projects, this doesn't error because we generate the correct ESLint ignore directive:

// Roles are passed in by the requireAuth directive if you have auth setup
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const requireAuth = ({ roles }) => {
return isAuthenticated()
}

What we need to do is add the correct directive for JS projects:

// eslint-disable-next-line no-unused-vars

@jtoar jtoar added topic/generators-&-scaffolds bug/confirmed We have confirmed this is a bug topic/crwa create-redwood-app and removed bug/needs-info More information is needed for reproduction topic/generators-&-scaffolds labels May 11, 2022
@jtoar jtoar moved this from Triage to Todo in Main May 11, 2022
@jtoar jtoar moved this from Todo to Backlog in Main May 11, 2022
@jtoar jtoar moved this from Backlog to Triage in Main May 11, 2022
@jtoar jtoar moved this from Triage to Backlog in Main May 11, 2022
@jtoar jtoar changed the title Eslint Error ESLint error on roles param in JS project Jul 19, 2022
@standuprey
Copy link
Contributor

#6037

@redwoodjs-bot redwoodjs-bot bot moved this from Backlog to Done in Main Jul 26, 2022
@jtoar jtoar moved this from Done to Archived in Main Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug good first issue help wanted topic/crwa create-redwood-app
Projects
Status: Archived
4 participants