Replies: 2 comments
-
This is really not a Brackets issue. I guess you are using ESLint. Strictly there is no error in what you have written. You are just getting a warning, that you have a variable that has not been used. If I were to write the simplest JS in the world, and start with a declaration:
As soon as I write that line, I get the same error you are getting. But there is no error, I just haven't gotten to it yet. As soon as I write the next lines:
The error goes away. Since now I have used the variable. Assuming you have code in some other file that will use the code above, you can just ignore the error. It is not really error, it is a warning that you have some slack code. It will run just fine - although alone it will do nothing. If you know that is what you want, then there is nothing to worry about. |
Beta Was this translation helpful? Give feedback.
-
Thank you for that explanation as it does help! I am not a coder at all but I know just enough to get by with little tiny things. So I appreciate this explanation as it is an error that comes up often when I run scripts for this type of project.
MERRY CHRISTMAS!
Terri Hansen
On Thursday, December 21, 2023 at 03:20:17 PM CST, JuriTuuti ***@***.***> wrote:
This is really not a Brackets issue. I guess you are using ESLint.
Strictly there is no error in what you have written. You are just getting a warning, that you have a variable that has not been used.
If I were to write the simplest JS in the world, and start with a declaration:
var name = 'Snoopy';
As soon as I write that line, I get the same error you are getting. But there is no error, I just haven't gotten to it yet. As soon as I write the next lines:
if (name === 'Snoopy') {
alert("You're a dog!")
};
The error goes away. Since now I have used the variable.
Assuming you have code in some other file that will use the code above, you can just ignore the error. It is not really error, it is a warning that you have some slack code. It will run just fine - although alone it will do nothing. If you know that is what you want, then there is nothing to worry about.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have a "config" page which houses the "title, code, version number and abbreviations".
Line 2 throws this error: ERROR: 'Config' is assigned a value but never used. [no-unused-vars] var Config={
What do I need to do to fix it? (I am not a coder)
Here is the code:
// title, code, v #, abbreviation titles
var Config = {
};
Beta Was this translation helpful? Give feedback.
All reactions