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

Reenable eslint on build command #325

Open
nickytonline opened this issue Jul 17, 2021 · 8 comments · May be fixed by #339
Open

Reenable eslint on build command #325

nickytonline opened this issue Jul 17, 2021 · 8 comments · May be fixed by #339
Assignees
Labels
good first issue Good for newcomers

Comments

@nickytonline
Copy link
Contributor

nickytonline commented Jul 17, 2021

Description

On build now with NEXT.js 11, eslint runs as part of the build. Currently it's erroring out with the following lint errors. Reenable linting on builds and fix the lint errors.

In next.config.js remove

-  eslint: {
-    // Warning: Dangerously allow production builds to successfully complete even if
-    // your project has ESLint errors.
-    ignoreDuringBuilds: true,
-  },
protege on  feature/upgrade-to-nextjs-11 [$!] via  v14.17.3 took 18s 
❯ y build                          
yarn run v1.22.10
$ next build
info  - Loaded env from /Users/yolo/dev/protege/.env.local
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types  

Failed to compile.

./pages/_app.js
58:7  Warning: Unexpected console statement.  no-console

./pages/account-select.js
1:10  Error: 'useState' is defined but never used.  no-unused-vars
1:20  Error: 'useEffect' is defined but never used.  no-unused-vars
2:8  Error: 'Link' is defined but never used.  no-unused-vars
33:11  Error: Missing an explicit type attribute for button  react/button-has-type
47:11  Error: Missing an explicit type attribute for button  react/button-has-type
59:11  Error: Missing an explicit type attribute for button  react/button-has-type

./pages/candidate/[displayName]/dashboard.js
14:42  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/candidate/[displayName]/edit-profile.js
25:44  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/candidate/[displayName]/index.js
4:42  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/company/[displayName]/[jobId]/[applicationId].js
15:44  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/company/[displayName]/[jobId]/edit.js
24:28  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/company/[displayName]/[jobId]/index.js
18:35  Error: Expected to return a value at the end of arrow function.  consistent-return
170:17  Warning: Dangerous property 'dangerouslySetInnerHTML' found  react/no-danger
186:17  Warning: Dangerous property 'dangerouslySetInnerHTML' found  react/no-danger

./pages/company/[displayName]/edit-profile.js
25:42  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/company/[displayName]/post-a-job.js
27:32  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/company/[displayName]/thanks.js
10:30  Error: Expected to return a value at the end of arrow function.  consistent-return

./pages/forgot-password.js
15:9  Error: 'router' is assigned a value but never used.  no-unused-vars
17:10  Error: 'loading' is assigned a value but never used.  no-unused-vars
40:14  Error: 'error' is already declared in the upper scope on line 19 column 10.  no-shadow

./pages/get-in-touch.js
19:10  Error: 'inputs' is assigned a value but never used.  no-unused-vars
73:14  Error: 'response' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars

./pages/job-board/index.js
9:10  Error: 'activeJobs' is assigned a value but never used.  no-unused-vars
9:22  Error: 'setActiveJobs' is assigned a value but never used.  no-unused-vars

./pages/learning-resources.js
55:3  Error: propType "learningResources" is not required, but has no corresponding defaultProps declaration.  react/require-default-props

./pages/sign-in.js
16:11  Error: 'currentUser' is assigned a value but never used.  no-unused-vars
17:10  Error: 'loading' is assigned a value but never used.  no-unused-vars
34:35  Error: 'control' is assigned a value but never used.  no-unused-vars
45:14  Error: 'error' is already declared in the upper scope on line 18 column 10.  no-shadow
51:9  Error: 'handleSignInWithGithub' is assigned a value but never used.  no-unused-vars
51:41  Error: 'data' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
55:14  Error: 'error' is already declared in the upper scope on line 18 column 10.  no-shadow

./pages/sign-up.js
19:10  Error: 'loading' is assigned a value but never used.  no-unused-vars
57:9  Error: 'handleSignInWithGithub' is assigned a value but never used.  no-unused-vars

./components/contributors/IndividualContributor.js
29:7  Error: Empty components are self-closing  react/self-closing-comp

./components/form/RadioInput.js
2:26  Error: Unable to resolve path to module 'formik'.  import/no-unresolved
4:24  Error: 'id' is missing in props validation  react/prop-types
4:28  Error: 'label' is missing in props validation  react/prop-types

./components/form/StatusBar.js
4:23  Error: Must use destructuring status assignment  react/destructuring-assignment

./components/form/TierSelectCard.js
26:7  Error: Empty components are self-closing  react/self-closing-comp

./components/global/FormCard.js
8:7  Error: Empty components are self-closing  react/self-closing-comp

./components/global/GlobalHeader.js
39:7  Warning: Unexpected console statement.  no-console
345:23  Error: Visible, non-interactive elements with click handlers must have at least one keyboard listener.  jsx-a11y/click-events-have-key-events
345:23  Error: Static HTML elements with event handlers require a role.  jsx-a11y/no-static-element-interactions
345:23  Error: Empty components are self-closing  react/self-closing-comp

./components/job/JobList.js
7:9  Error: 'jobs' is assigned a value but never used.  no-unused-vars
10:55  Error: 'useState' is not defined.  no-undef
12:3  Error: 'useEffect' is not defined.  no-undef
13:20  Error: 'fetchApplications' is defined but never used.  no-unused-vars
59:25  Error: 'JobItem' is not defined.  react/jsx-no-undef
66:14  Error: 'CompanyDashboardEmpty' is not defined.  react/jsx-no-undef
98:12  Error: 'archivedListings' is not defined.  no-undef
108:11  Error: 'archivedListings' is not defined.  no-undef

./components/user/ProfileMenu.js
20:16  Error: 'setLogo' is assigned a value but never used.  no-unused-vars

Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Originally posted by @nickytonline in #324 (comment)

Related Issues

Depends on #324 being merged .

@github-actions
Copy link

Thanks so much for submitting an issue! We have received it, will review it soon and follow up.
For our contibution guidelines, please check out our contributors guide.

@nickytonline nickytonline added the good first issue Good for newcomers label Jul 17, 2021
@nickytonline nickytonline changed the title On build now with NEXT.js 11, eslint runs as part of the build. Currently it's erroring out with the following lint errors. ~I will fix these as part of the upgrade @drewclem, or would you like me to disable eslint on build for now? (It's a [config setting in NEXT.js](https://nextjs.org/docs/api-reference/next.config.js/ignoring-eslint)). We could open a separate issue to fix the lint errors and once those are sorted we could reenable it.~ Reenable eslint on build command Jul 17, 2021
@secondl1ght
Copy link

If this is still needed to be done then I can do it, just let me know.

@nickytonline
Copy link
Contributor Author

@secondl1ght, yes ut still needs to be done. Assigning it to you! 😎

secondl1ght added a commit to secondl1ght/protege that referenced this issue Oct 11, 2021
@secondl1ght secondl1ght linked a pull request Oct 11, 2021 that will close this issue
@secondl1ght
Copy link

Alrighty thanks, fixed with PR #339!

@nickytonline
Copy link
Contributor Author

As mentioned in PR #339, the aside from removing the configuration, the lint errors need to be fixed as well.

@secondl1ght
Copy link

Oops yes you are right I missed that part, for the unused variables do you want them commented out or deleted outright?

@nickytonline
Copy link
Contributor Author

Oops yes you are right I missed that part, for the unused variables do you want them commented out or deleted outright?

If they are unused variables, remove them. No point on keeping dead code around.

@secondl1ght
Copy link

Ok and I think I should probably try building again and getting an updated output. Because I am sure things have changed to the codebase since this lint report was generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants