Skip to content

Eslint check#119

Merged
RoiArthurB merged 59 commits intodevfrom
eslint_check
Feb 27, 2026
Merged

Eslint check#119
RoiArthurB merged 59 commits intodevfrom
eslint_check

Conversation

@GuillaumeLeroy34
Copy link
Contributor

Pull Request

Checklist

  • Code is complete and ready for review
  • Tests have been added/updated (if applicable)
  • Documentation has been updated (if applicable)

Description

Addressed all eslint problems. This goes from simple syntaxic errors (not using brackets when using the logger for example) to bigger problems.
A special attention was paid to the Selector simulation component, reworked how it works to be a bit more unreliable, avoided cases where its list of simulation can be undefined by assigning it at creation, and having roadblocks avoiding trying to render undefined elements.
added "entries" property in the interface Simulation contained in the constants.ts file for better typing. Removed or commented a lot of unused functionalities, those mostly being the unused "gama display" mode, that is not going to be implemented in the foreseeable future, cleaning up massively some components.
cleaned up imports and unused variables.

Removed unused pages, like streamplayerscreenControl, whose functionnality can be implemented directly in streamplayerscreen. Removing it means less problems, only one file needs to be implemented. Removed unused Test component that should never have left the dev branch

I fixed my linter, which for some reason didn't highlight ~90% of errors

Related Issue

…to accomodate for some space for a gama simulation
…s and can't be written directly in the useState
…sed, and its functionnality is best done directly on the streamplayerscreen components instead of having another component that acts nearly the same
…(containing only a single element), redefned it to array[]. Assigned simulationList to it on creation to avoid undefined cases, but added checks to avoid undefined issues by using ternary operators in the template that return null or a simple string if subProjectsList is undefined.
…ot properly reset when selecting a sub project folder
…tor. checking the size of the subProjectList is pointless now, as it is the only list used. Also clarified the comment explaining the div
… interface. These can be added back in a later interation of the app
… by the MODEL and CATALOG defined in constants.
… catalog instead of testing the length of the attribute "entries", which is much cleaner
…hat the subprojectList[index] is always a VU_CATALOG_SETTING_JSON, and removed unecessary if statement, as we only use the subProjectsList for clarity now
…ained a set of subprojects, but this hceck is no longer necessary. Reworded the log ( couldn't separate this into 2 different commits)
…G_SETTING_JSON, VU_MODEL_SETTING_JSON instead. selected simulation is always of type MODEL, while simulationList can contain both.
Copy link
Contributor

@RoiArthurB RoiArthurB left a comment

Choose a reason for hiding this comment

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

Better but still some work to really finish to cleaning the project.

Also, since you're using the interfaces to type received JSON, maybe you can do some check on them instead of the json.type == string. This would ensure that the rest of the code is manipulating this objects. But no necessary for this PR.

} else if (Array.isArray(simulationList[index])) {
logger.debug(simulationList[index].model_file_path)

if (subProjectsList[index].type === "catalog") { //? we additionaly check if the simulation is a catalog, not necessary but allows for adding extra types
Copy link
Contributor

Choose a reason for hiding this comment

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

Also check that it's matching the interface VU_CATALOG_SETTING_JSON

addToPath(index)
if (simulationList[index].splashscreen !== undefined) {
setSelectedSplashscreen(simulationList[index].splashscreen);

Copy link
Contributor

Choose a reason for hiding this comment

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

Empty line :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong logger id name VideoStreamManager

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

try {
addToPath(index)
logger.debug("[SELECTOR SIMULATION] handlesimulation, simulationList[index].type == catalog, {name}", { name: subProjectsList[0].name });
logger.debug("[SELECTOR SIMULATION] handlesimulation, simulationList[index].type == catalog, {name}", { name: subProjectsList[index].name });
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove capsule and properly use Logtap configuration (you have to put those informations in the getLogger function)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return updatedPlayerList;
});
logger.info(" This player have been removed from playerList : ", id);
logger.info(" This player have been removed from playerList : ", {id});
Copy link
Contributor

Choose a reason for hiding this comment

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

Bump

import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";

export default defineConfig([
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments to explain how you configured ESLint as it's a bit complicated to read as is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used "npm init @eslint/config@latest" as per the official documentation, followed the steps in the terminal, which ended up making this configuration file. I didn't write it by hand, nor should we read it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cannot directly answer to the comment, but since the types are not proper classes but instead instances, it would require implementing type guard functions as using instanceof is not possible since interfaces are ditched at runtime. As per the official typescript documentation, this would require creating a function that will also just check the type attribute of the interface.

A cleaner implementation (using instanceof) would require classes, which would make the constant file bigger and heavier, I think that the current system is a good compromise.

@sonarqubecloud
Copy link

@RoiArthurB RoiArthurB merged commit 7e1e467 into dev Feb 27, 2026
2 checks passed
@RoiArthurB RoiArthurB deleted the eslint_check branch February 27, 2026 04:53
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