Documentation for Static Code Analysis through a command line and not through VSCode extension
dani-oropeza-nic opened this issue Β· comments
π Request documentation enhancements
Description
There is not enough documentation to do the following: analyze code statically with a command line. I would like to run a command and start analyzing the static code of all the HTML files in my Angular application.
Details
@captainbrosset, @vidorteg, @molant
When running the command npx hint something.html
, this error message is displayed in the console.
However, when adding local configuration, It seems that It is not checking the files correctly because something.html
has accessibility errors, and the linter says "Finishing..." and it doesn't show anything else
Can you please give me a hand with this? I've been trying to do it for several days
These are my dependencies
Another clue: when I remove the .hintrc
file and then I execute this command npx hint something.html
. It does check against the default rules.
Hello @captainbrosset, @vidorteg, @molant, could you please give me a hand with this?
Can you give me a little time please, I am going through a security issue at the moment. I was hacked into
Of course I do, I'll be attentive to the comments of this Issue for when you're ready. Sorry for the security issue.
Hello @str13tlfe, @captainbrosset, @vidorteg, @molant, can you give me a hand with this please?
I do see some issues when mixing some configurations and hints e.g:
{
"connector": {
"name": "local"
},
"extends": ["accessibility"],
"hints": {
"axe/language": "error"
}
}
can you try something like this:
{
"connector": {
"name": "local"
},
"extends": ["development"],
"hints": {
"axe/language": "error"
}
}
on a simple test page? (opening and close html
tags), you can then take out some of the specific hints that you are not using.
Also, for static analysis on vscode you can use the Edge Devtools extension which includes webhint and does this automatically for you (you can also configure it via .hintrc
files), you can install it in:
https://marketplace.visualstudio.com/items?itemName=ms-edgedevtools.vscode-edge-devtools
@vidorteg Thank you for your response. However, I think I don't get it yet.
Look at the first screenshot here below. The extension is "development"
and when I execute the command npx hint something.html
, 5 errors were found.
And then executing the same command, but simply changing the extension to "accessibility"
, it doesn't find anything. the console says "its ok", which I think it is wrong.
According to the documentation here... https://webhint.io/docs/user-guide/hints/hint-axe/, The "accessibility" extension should have the "axe/text-alternative"
rule, but it seems that it does not have.
I don't know if it is a problem of the library or my configuration...
Regarding to your questions:
on a simple test page? Initially, yes. Because I just want to make it work. The next step will be to apply that configuration for all .html files.
"for static analysis on vscode you can use the Edge Devtools extension" Yes I can use that extension, however, we want to do the static web analysis via executing a command. In other words, we want to execute this command in the deploy pipeline and before making a git commit.
π Request documentation enhancements
Description
There is not enough documentation to do the following: analyze code statically with a command line. I would like to run a command and start analyzing the static code of all the HTML files in my Angular application.
Details
@captainbrosset, @vidorteg, @molant
When running the command
npx hint something.html
, this error message is displayed in the console.However, when adding local configuration, It seems that It is not checking the files correctly because
something.html
has accessibility errors, and the linter says "Finishing..." and it doesn't show anything elseCan you please give me a hand with this? I've been trying to do it for several days
These are my dependencies
Another clue: when I remove the
.hintrc
file and then I execute this commandnpx hint something.html
. It does check against the default rules.