Nrlint eslint:recommended rules not applied

Hi everyone!
I am trying to check my function nodes code with function-eslint rule in nrlint.
nrlint version - 1.0.2
node-red version - 2.0.6
NodeJS version - 14.17.3

The function-eslint rule configuration is default

{
    "env": {
        "es2021": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 12
    },
    "rules": {}
}

But the default eslint rules from eslint:recommended config are ignored by linter
For example i write the code which will trigger the "for-direction" rule from eslint.

for (var i = 0; i < 10; i--) {
}

and don't get any warning in the linter panel.
Manually specifying the rule in the rules section fixes the problem:

{
    "env": {
        "es2021": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 12
    },
    "rules": {
        "for-direction": "error"
    }
}

In this configuration linter works as expected
image

Running nrlint from console gives the same result.

Minimal flow to reproduce the problem:

[{"id":"d553f0ca4cf61cfb","type":"function","z":"3b054f355f3c4034","name":"","func":"for (var i = 0; i < 10; i--) {}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":280,"wires":[[]]}]

The problem doesn't depend on the rule(tried multiple rules from eslint:recommended config)

Is it possible to not manually specify the default rules in config? Thanks in advance.

Please raise an issue on the nrlint repository so it can be looked at.

I agree it would make sense to be able to do this, but I'm not sure if the eslint we bundle to run in the browser knows about the recommended rule sets like 'normal' eslint does.

Thanks for the hint! I've looked into eslint4b code, which is used by function-eslint rule. Internally it calls eslint Linter module, which seems to be expecting "extended rules" to be included in rules object of config by some other code. So current behaviour is not a bug, and to make these rules apply I just need to specify them in the rules section.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.