Closed cagross closed 2 months ago
in the flat config, its order matters. it's recommended to put your own config to the last to avoid overwritten by the 3rd-party configs:
module.exports = [
promise.configs['flat/recommended'],
{rules : {'promise/catch-or-return': 0,}}
];
OK understood. The rule needs to be defined first, then disabled. In my case, I was trying to disable first, before the rule was defined. Does that sound right?
Anyway, making your change resolved the issue, so thanks. I'll keep this in-mind for the future.
the rule was enabled in the preset, so in your case, it's like:
module.exports = [
{rules : {'promise/catch-or-return': 0,}},
{rules : {'promise/catch-or-return': 2,}}, // flat/recommended
];
eslint will deep-merge these config objects in turn, with the later ones overriding the earlier ones( something like Object.assign()
). so the it's enabled in the calculated config.
Ah OK I see. Thanks very much for all that, and the prompt response.
Description
[Description of the issue or feature request]
Steps to Reproduce
Expected behavior: I expect the VSCode output panel to contain zero entries related to these rules.
Actual behavior: The VSCode output panel contains entries related to these rules (see screenshot below).
Versions
[Please fill this in if you are submitting a bug report]
Additional Information
See below for the full contents of my eslint.config.js file. I can confirm this is the config being applied to the file in-question. Prior to updating eslint to v9.0, my .eslintrc file was also configured to ignore these two rules, and VSCode was successfully doing so. I tried changing the property value from
0
to'off'
(e.g.promise/catch-or-return': 'off'
) but that didn't change anything.