Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Option Error thrown with "no-duplicate-selectors" rule. #5221

Closed
james0r opened this issue Mar 31, 2021 · 2 comments
Closed

Invalid Option Error thrown with "no-duplicate-selectors" rule. #5221

james0r opened this issue Mar 31, 2021 · 2 comments

Comments

@james0r
Copy link

james0r commented Mar 31, 2021

Clearly describe the bug

Invalid Option Error thrown when using "no-duplicate-selectors": false rule even though the rule seems to take effect on my SCSS with stylelint-scss plugin added.

Which rule, if any, is the bug related to?

no-duplicate-selectors

What code is needed to reproduce the bug?

  extends: "stylelint-config-recommended",
  plugins: [
    /**
     * add plugins
     * docs: https://stylelint.io/user-guide/configure#plugins
     */
    'stylelint-scss'
  ],
  ignoreFiles: [
    /**
     * ignore certain files
     * docs: https://stylelint.io/user-guide/configure#ignorefiles
     */
    // 'my-file.css',
    // '**/my-directory/*.css'
  ],
  rules: {
    /**
     * add custom rules
     * docs: https://stylelint.io/user-guide/rules/list
     */
    "at-rule-no-unknown": null,
    "scss/at-rule-no-unknown": true,
    "no-empty-source": false,
    "no-descending-specificity": null,
    "no-duplicate-selectors": false
  },
};

What stylelint configuration is needed to reproduce the bug?

See above.

Which version of stylelint are you using?

13.10.0

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

Webpack plugin

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

Yes, SCSS

What did you expect to happen?

Duplicate selectors are ignored and no errors to stdout.

What actually happened (e.g. what warnings or errors did you get)?

Invalid Option: Unexpected option value "false" for rule "no-empty-source"
@hudochenkov
Copy link
Member

Thanks for the report and for using the template.

To disable a rule use null, and not false.

@james0r
Copy link
Author

james0r commented Mar 31, 2021

Thanks for your reply.

This would be a helpful addition to the detail page for this rule and perhaps others.

https://stylelint.io/user-guide/rules/no-duplicate-selectors

I do not see the null value indicated anywhere there.

To add to the confusion the nested option takes 'false'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants