ProjectProtege / protege

Remote jobs for junior developers
protege.vercel.app
MIT License
67 stars 39 forks source link

Reenable eslint on build command #325

Open nickytonline opened 3 years ago

nickytonline commented 3 years ago

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 https://github.com/drewclem/protege/issues/324#issuecomment-881900859

Related Issues

Depends on #324 being merged .

github-actions[bot] commented 3 years ago

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.

secondl1ght commented 2 years ago

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

nickytonline commented 2 years ago

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

secondl1ght commented 2 years ago

Alrighty thanks, fixed with PR #339!

nickytonline commented 2 years ago

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

secondl1ght commented 2 years ago

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

nickytonline commented 2 years ago

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 commented 2 years ago

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.