Example of eslintRules?

Does someone have an example for the eslintRules in Project Properties?

I’m not sure what the expected syntax is. After several attempts, I’m not seeing any changes in the lint results, so I assume I’m doing everything wrong.

What are you trying to accomplish?

In AppStudio 9, currently in Beta, we update the Eslint rules to the latest version.

I use many legal conventions that the default eslint lists as errors or warnings. For example, using double quotes instead of single quotes for strings.

My understanding is that eslint can be “tuned” using a configuration placed in the eslintRules field in Project Properties.

To answer your question, the eslint feature would be more helpful if I could turn off the 98% of errors/warnings that I don’t care about or don’t apply to me.

For example, I thought I can configure something like:

 "quotes": "off"

or

{
     "rules": {
        "quotes": off
     }
 }

or

rules:
  quotes:
   - off

If tuning eslint is not possible, please let me know.

If it is possible, I have no idea how to format the options to do so. So an example would probably make it clear.

That makes sense. I’ll put together a sample of the usage.

Don’t mean to push, but any progress?

If it’s posted somewhere I missed, please point me in the right direction.

Thanks!

I’m sorry for the tardy reply.

I dug into this - this feature this is indeed broken in AppStudio. I have opened an issue to get it fixed.

Glad to hear this has been fixed in the next version.

Since I just spent some more time playing with lint, I’d like to hear from some lint experts on how to properly use lint. My problem with it is…

The list of errors seems to have nothing to do with the code and everything to do with the NSB IDE. For example, I get a ton of “variable XXXXXX is used by not declared” errors. Well, duh, variable XXXXXX in a different file. In fact, all the constants are in the Project Properties and Global Code file. So, I always get those errors (a lot of them!). Plus, even more boring ones, like “spaces on the end of the line” errors.

On top of all that, it seems that lint stops linting around 150 errors. So even if a serious error appears later in the file, you don’t get that error report.

Am I doing something wrong? How do any of you get any utility/benefit/value out of using lint?

You can declare global variables by adding a comment at the top of a module:

/* globals
  frmAbout:false
  frmSpinner:false
  btnAboutPayNow:false
  btnAboutPrivacy:false
  btnAboutRecheck:false
  divAboutMessageBox:false
  divAboutPayment:false
  divAboutVersion:false
  btnHomePay:false
  api:false
  config:false
  pageTransition:false
  router:false
  util:false
  api:false
*/

That will get rid of a lot of your messages!

Yes, it only reports the first 150. It’s trying to be merciful. :slightly_smiling_face:

Indeed. Thank you!