Skip to content

Reenable eslint on build command #325

Description

@nickytonline

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 .

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions