-
Notifications
You must be signed in to change notification settings - Fork 179
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
Improve frontend lint settings #969
Improve frontend lint settings #969
Conversation
8b9d74b
to
dd2cb43
Compare
…lute path. add no-param-reassign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaoDaoNoCode is there a reason we are not excluding from 'directory/file'
now that we have ~
? Eg frontend/src/services/notebookService.ts has import { RecursivePartial } from 'typeHelpers';
and you passed the linter.
export const allSettledPromises = <T, E extends unknown = undefined>( | ||
export const allSettledPromises = <T, E = undefined>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... not sure why I did that originally.
@andrewballantyne I thought of that, and at first, I tried to create a glob pattern matching like
Which option do you think is better? |
Hmmmm -- are you sure there is no way to just block non npm dependencies? Surely there is a webpack setting or something; I swear I recall this being a thing 🤔 I'd be shocked if there was no way to stop root-level imports like |
Is there a reason to use the tilde Example - these have the same outcome assuming folder structure has import { ... } from "folder" import { ... } from "~/folder" |
Yuppers -- because Will we conflict with a folder and a npm package? Probably not... but it is the same as "why use Is there a reason you're against it @Gkrumbach07 ? |
Nope, it just seemed like extra chars at first glance. But the reasons to use it make sense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging to avoid the expected conflicts that will happen when ever single PR merges before this -- easier for them to adjust than for you to adjust.
One note I found with no-console... definitely can be a follow up though.
@@ -39,6 +40,7 @@ const useTimeBasedRefresh = (): SetTime => { | |||
`We should have refreshed but it appears the last time we auto-refreshed was less than an hour ago. '${KEY_NAME}' session storage setting can be cleared for this to refresh again within the hour from the last refresh.`, | |||
); | |||
} | |||
/* eslint-enable no-console */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... wonder if we can disable block disable/enables -- seems easy to abuse.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* update config of eslint, webpack, ts, jest and dependencies * run lint fix command to get rid of most linting errors * manually get rid of all the warnings and errors that cannot be auto fixed * manually add ~ alias to all previous absolute imports in frontend * add rule to prevent else return and absolute import from src folder * another round of lint --fix * move mock files and change imports * add no-console rule and disable console as needed in code * add restriction to import from api and change the rules of using absolute path. add no-param-reassign * add order rule and run lint fix command * remove baseUrl from tsconfig and make corresponding changes to eslintrc --------- Co-authored-by: Andrew Ballantyne <8126518+andrewballantyne@users.noreply.github.com>
* update config of eslint, webpack, ts, jest and dependencies * run lint fix command to get rid of most linting errors * manually get rid of all the warnings and errors that cannot be auto fixed * manually add ~ alias to all previous absolute imports in frontend * add rule to prevent else return and absolute import from src folder * another round of lint --fix * move mock files and change imports * add no-console rule and disable console as needed in code * add restriction to import from api and change the rules of using absolute path. add no-param-reassign * add order rule and run lint fix command * remove baseUrl from tsconfig and make corresponding changes to eslintrc --------- Co-authored-by: Andrew Ballantyne <8126518+andrewballantyne@users.noreply.github.com>
Description
closes frontend part of #469
Frontend:
~/...
instead of relative pathservices/**
,pages/**
, etc...~/api
folder not to use the specific file pathHow Has This Been Tested?
Merge criteria: