CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Example '.cflintrc` actually doesn't run anything.

Open cybersonic opened this issue 6 years ago • 5 comments

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?

cybersonic avatar May 03 '18 15:05 cybersonic

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?

ryaneberly avatar May 05 '18 01:05 ryaneberly

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.

cybersonic avatar May 05 '18 09:05 cybersonic

That's clean. Does commandbox already implement

box cflint

? I haven't used it.

ryaneberly avatar May 05 '18 17:05 ryaneberly

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.

cybersonic avatar May 05 '18 17:05 cybersonic

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.

KamasamaK avatar May 05 '18 18:05 KamasamaK