Resolving eslint Issues in Projects

1 Like

aprilsamy1 You are getting this error because of Eslint for this you can install Eslint extension in VScode to detect errors and solve them or you can also use command eslint --fix

eslint --fix will fix every rule violation it is capable of fixing, actually overwrite the code, and print out any warnings or errors it was incapable of fixing.

After fixing those warnings that you are getting in the terminal you will be able to commit

3 Likes

Ok yash i will try and update you soon

I think it’s not working :frowning:

Hey @aprilsamy1, first of all, you have to follow dco rules for the commit that is using git commit -s and then write your commit-msg.
Secondly can you tell in which files you have done changes according to the screenshot

2 Likes

I make changes in the following 3files

can you try eslint --fixwith git bash in given screenshot seems like you are running it in powershell or cmd

also eslint extension is responsible for showing error directly inside vscode by adding red underline in code it has nothing to do with eslint --fix

1 Like

Yes ! I was running in terminal of vscode but i was try in bash but showing eslint : command not found

@aprilsamy1 the lint is failing your commit because of the extra spaces which is not shown in IDE. You can instead use a text editor to remove that extra spaces and then make the commit. If it still gives you the same error I suggest you to commit the change to your own repo first and edit the codebase there.

1 Like

Hello @aprilsamy1,
So lets get you unblocked one at a time.

As @Yash.Sharma suggested you have to run eslint to fix those issues automatically or you can solve them one by one by following the suggestions provided in the console.

To solve automatically you can use either of the two commands:

  1. npm run lint
    or
  2. npx eslint . --fix (eslint . --fix, will only work if you have eslint installed as global package, since you haven’t try npx eslint . --fix )

If you are annoyed with the red markers in the UI for no reason, you can disable eslint from the visual studio code, the code when you commit will automatically be linted with the configuration provided in the meshery-ui so you don’t have to worry.

Edited the answer, after I got to know that your concern is related to layer5 UI and not meshery-ui

1 Like

Thanks to all and special thanks for @Abhi 1st one work for me so i commited and raise a pr #3946 :sparkles:
But getting this warning can you elaborate this what is it ?

1 Like

From here you can take on google to ask some of these questions :grin:

Hi @aprilsamy1 I think you have some unused variables in your react project