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 lint warnings and configure build to fail on lint warning #5231

Closed
akhenry opened this issue May 19, 2022 · 4 comments · Fixed by #5258
Closed

Fix lint warnings and configure build to fail on lint warning #5231

akhenry opened this issue May 19, 2022 · 4 comments · Fixed by #5258
Labels
type:maintenance tests, chores, or project maintenance
Milestone

Comments

@akhenry
Copy link
Contributor

akhenry commented May 19, 2022

Summary

Some code has slipped in that triggers lint warnings. Our build currently only fails on lint errors, not warnings. Let's fix the lint warnings and modify the build config to fail on warning.

The linter can be run from the command line using npm run lint.

To make eslint fail on warning use the --max-warnings flag documented here.

These are the warnings it's showing right now:

src/api/objects/MutableDomainObject.js
  96:89  warning  Consider using the native optional chaining to get nested values and nullish coalescing operator for fallback values  you-dont-need-lodash-underscore/get

src/plugins/imagery/components/ImageControls.vue
  110:9  warning  Prop 'imageUrl' requires default value to be set  vue/require-default-prop

src/plugins/imagery/components/ImageryView.vue
  58:14  warning  Expected 1 space after '{{', but not found   vue/mustache-interpolation-spacing
  58:34  warning  Expected 1 space before '}}', but not found  vue/mustache-interpolation-spacing

src/ui/toolbar/Toolbar.vue
  184:20  warning  Consider using the native optional chaining to get nested values and nullish coalescing operator for fallback values  you-dont-need-lodash-underscore/get

✖ 5 problems (0 errors, 5 warnings)
  0 errors and 2 warnings potentially fixable with the `--fix` option.
@akhenry akhenry added the type:maintenance tests, chores, or project maintenance label May 19, 2022
@unlikelyzero
Copy link
Collaborator

@akhenry @ozyx this may cause complications with our e2e tests

@ozyx
Copy link
Member

ozyx commented May 24, 2022

@akhenry @ozyx this may cause complications with our e2e tests

Are you referring to the playwright/no-wait-for-timeout rule? I notice that the percy, imagery, and log plot tests rely on explicit waits in order to run correctly. We could disable this rule for specific files or folders if we want.

@unlikelyzero
Copy link
Collaborator

Testing Notes

Verify that no warnings are thrown when running npm run lint
Implement make a local codechange that would violate a rule in the e2e suite and vue files. Run npm run lint and verify that they're thrown

@alizenguyen
Copy link
Contributor

Verified Testathon 06/15/2022

@unlikelyzero unlikelyzero added this to the Target:2.0.5 milestone Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants