CFLint
CFLint copied to clipboard
Example '.cflintrc` actually doesn't run anything.
The example .cflintrc
will not return you any errors even if you do have errors in your cfml as it has an empty structure in the includes
key.
This example (cleaned so no more default errors are shown):
{
"rule" : [ ],
"excludes" : [ ],
"includes" : [ {
} ],
"inheritParent" : false,
"parameters" : {}
}
Has an empty structure in the includes. So without knowing the full documentation, this is saying "Do not include any rule" it seems. So if I run this on a very error prone CFML page I get no problems (silently).
Removing the {}
it now runs all the rules.
So this either means that we need to have some error when there is an empty structure such as:
- No rules to run have been defined
Or it needs to be removed from the example in the readme?
Does it make sense to support something like
npm init
eslint --init
from the command line (and the api for IDE's).
This could create a shell .cflintrc file in the current directory. It could include a few simple questions to get the basic configuration the user wants. Rule groups could be used.
I'm thinking something like
java -jar cflint-n.n.n-all.jar -init
and perhaps
java -jar cflint-n.n.n-all.jar -ignore VAR_INVALID_NAME
the 1st would do a guided created of the config file, the second would simply update it with an exclude rule.
Thoughts?
Yeah definitely. If this can be mixed with commandbox so that all you do is:
box install commandbox-cflint box cflint init
Mark Drew
On 5 May 2018, at 02:54, ryaneberly [email protected] wrote:
Does it make sense to support something like
npm init eslint --init from the command line (and the api for IDE's).
This could create a shell .cflintrc file in the current directory. It could include a few simple questions to get the basic configuration the user wants. Rule groups could be used.
I'm thinking something like
java -jar cflint-n.n.n-all.jar -init and perhaps
java -jar cflint-n.n.n-all.jar -ignore VAR_INVALID_NAME the 2nd would be an update
Thoughts?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
That's clean. Does commandbox already implement
box cflint
? I haven't used it.
Yeah, I haven’t used this version yet but will be doing so shortly
https://www.forgebox.io/view/commandbox-cflint
Mark Drew
On 5 May 2018, at 18:46, ryaneberly [email protected] wrote:
That's clean. Does commandbox already implement
box cflint
? I haven't used it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
An init
would be very useful. The NPM wrapper has this already. I also implemented a couple commands in my VS Code extension that do that.