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

Ec36 avoid autoplay #40

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

Conversation

chihebtalan
Copy link

No description provided.

@chihebtalan chihebtalan force-pushed the ec36-avoid-autoplay branch from 9e1fab7 to 4f1705e Compare May 30, 2024 12:42
Co-authored-by: Diane Cordier <diane.cordier44@gmail.com>
@chihebtalan chihebtalan force-pushed the ec36-avoid-autoplay branch from 4f1705e to 5a3b699 Compare May 30, 2024 12:43
chihebtalan and others added 2 commits May 30, 2024 15:06
Co-authored-by: Diane Cordier <diane.cordier44@gmail.com>
Co-authored-by: Diane Cordier <diane.cordier44@gmail.com>
Copy link
Member

@utarwyn utarwyn 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 this awesome work! 💪 I have done some reviews..

@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add support for SonarQube up to 10.5
- Add rule EC36
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an item in the changelog instead of editing this one?


⚠️ This rule _warns_ in the ✅ `recommended` config.

<!-- end auto-generated rule header -->
Copy link
Member

Choose a reason for hiding this comment

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

This generated header has been added twice.. can you remove one of it please?
(or all of them and re-run npm update script)

EnforcePreloadNone:
"Set preload='none' for <video> and <audio> elements. Reference to Rule RGESN 4.1 : https://www.arcep.fr/mes-demarches-et-services/entreprises/fiches-pratiques/referentiel-general-ecoconception-services-numeriques.html",
NoAutoplay_EnforcePreloadNone:
"Avoid using autoplay attribute and set preload='none' for <video> and <audio> elements. Reference to Rule RGESN 4.1 : https://www.arcep.fr/mes-demarches-et-services/entreprises/fiches-pratiques/referentiel-general-ecoconception-services-numeriques.html ",
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of having multiple messages based on the context, awesome 👍
But I prefer to do not have the reference here, as this string will be the rule title used in SonarQube and it should be a way longer than accepted in the UI. Can you remove it from all messages?

messageId: "EnforcePreloadNone",
type: "JSXAttribute",
};
const expectedError3 = {
Copy link
Member

Choose a reason for hiding this comment

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

Can you rename these error variables to make them more explicit?

@@ -43,7 +43,8 @@ public static List<Class<? extends JavaScriptCheck>> getAllChecks() {
NoMultipleStyleChanges.class,
PreferCollectionsWithPagination.class,
PreferShorthandCSSNotations.class,
ProvidePrintCSS.class
ProvidePrintCSS.class,
AvoidAutoPlay.class
Copy link
Member

Choose a reason for hiding this comment

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

Can you put it in an alphabetical order? This will prevent (I hope) some conflicts with other PRs

@@ -1,6 +1,7 @@
{
"name": "ecoCode",
"ruleKeys": [
"EC13"
"EC13",
"EC36"
Copy link
Member

Choose a reason for hiding this comment

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

as the rule is both for JavaScript and TypeScript, you don't need to put it here (TypeScript-only rules)

Copy link
Member

Choose a reason for hiding this comment

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

Even if the build passes thanks to the presence of this file, I propose to remove it from the PR in order to merge your work. But yes we will need to wait for the next release of ecocode-rules-specifications

Copy link
Member

Choose a reason for hiding this comment

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

same review as the HTML file

@utarwyn utarwyn added 🗃️ rule Impacts a rule 🏆 challenge 🏆 Work done during the ecoCode Challenge labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏆 challenge 🏆 Work done during the ecoCode Challenge 🗃️ rule Impacts a rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants