Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 views
in Technique[技术] by (71.8m points)

javascript - Receiving defined but never used while indeed using in another file

I am not using modules I just include my scripts in the html file.

<script language="javascript" type="text/javascript" src="./scripts/processhandling.js"></script>

I call the functions in the html or in other scripts but the linter says 'aodv_clear_statistics' is defined but never used.eslintno-unused-vars Because I don't call it in the same file or even call in the same file but inside a string

<button type="submit" class="aodvResetButtonAll" onclick="aodv_clear_statistics()">Clear The Table</button>

Part of the Filestructure

- public
       - scripts 
                - aodvAreaManagement.js --> // here is the function
                - cookies.js --> // here are also functions with the message. Which get called in index.html
       - index.html

Here my .eslintrc.json

{
    "env": {
        "browser": true,
        "es2021": true,
        "node": true
    },
    "extends": [
        "airbnb-base"
    ],
    "parserOptions": {
        "ecmaVersion": 12
    },
    "rules": {
    }
}

Question: How can I avoid receiving the linter message 'aodv_clear_statistics' is defined but never used.eslintno-unused-vars while using var/function in seperate file?

question from:https://stackoverflow.com/questions/65882338/receiving-defined-but-never-used-while-indeed-using-in-another-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...