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 compile warnings #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ZardenSawtooth
Copy link

Fixed several compile warnings

♻️ Current situation & Problem

Fixed the following compile warnings to maintain a cleaner compile window.

src/components/AdvancedQuestionOptions/AdvancedQuestionOptions.tsx
  Line 266:33:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/components/Languages/Translation/TranslateSettings.tsx
  Line 38:44:  Array.prototype.map() expects a return value from arrow function  array-callback-return

src/components/Metadata/MetadataEditor.tsx
  Line 34:11:  'getUseContextSystem' is assigned a value but never used  @typescript-eslint/no-unused-vars

src/components/Navbar/Navbar.tsx
  Line 119:90:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

src/components/Question/Question.tsx
  Line 18:31:  'isItemControlReceiverComponent' is defined but never used   @typescript-eslint/no-unused-vars
  Line 39:5:   'canTypeHaveSublabel' is defined but never used              @typescript-eslint/no-unused-vars
  Line 57:33:  'setIsMarkdownActivated' is assigned a value but never used  @typescript-eslint/no-unused-vars
  Line 78:11:  'getSublabelText' is assigned a value but never used
@typescript-eslint/no-unused-vars

src/components/Question/QuestionType/Choice.tsx
  Line 24:50:  'isItemControlDropDown' is defined but never used  @typescript-eslint/no-unused-vars

✅ Testing

Ensured that the compile warnings are gone.

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@ZardenSawtooth ZardenSawtooth marked this pull request as ready for review August 21, 2024 20:08
Copy link
Member

@vishnuravi vishnuravi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR @ZardenSawtooth! I've added a few comments. Feel free to follow up with any questions you have.

cc: @PSchmiedmayer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change appears to have caused a side effect whereby the title is now styled as an underlined hyperlink as opposed to white text, and the color clashes with the navbar making it hard to read. Is there another method of resolving this warning that would preserve the original styling?

Screenshot 2024-08-23 at 10 57 10 AM

Comment on lines -78 to -81
const getSublabelText = (): string => {
return props.item.extension?.find((x) => x.url === IExtentionType.sublabel)?.valueMarkdown || '';
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be some code referencing this helper function that is currently commented out. If this function is to be removed, I would also recommend removing the commented out code that is referencing it.

Comment on lines -57 to +56
const [isMarkdownActivated, setIsMarkdownActivated] = React.useState<boolean>(!!props.item._text);
const [isMarkdownActivated] = React.useState<boolean>(!!props.item._text);
Copy link
Member

@vishnuravi vishnuravi Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the function that allows us to set this state variable, what is the purpose of keeping the state variable? Can we remove it all together and refactor the code referencing it?

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

Successfully merging this pull request may close these issues.

2 participants