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

Add quiet option to Node API #4476

Closed
duanehutchins opened this issue Dec 4, 2019 · 4 comments
Closed

Add quiet option to Node API #4476

duanehutchins opened this issue Dec 4, 2019 · 4 comments
Labels
status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules

Comments

@duanehutchins
Copy link

Clearly describe the bug

The Node API ignores the quiet option. You can confirm that the quiet option is not used in lib/standalone.js.

Example gulpfile.js:

gulp.task('stylelint', () => {
    const stylelint = require('stylelint');
    const options = Object.assign(argv, {
        files: 'sass/**/*.scss',
        formatter: 'string',
        quiet: true,
      });
    return stylelint.lint(options).then(data => {
        console.log(data.output);
    });
});

Even though quiet: true, the warnings are not suppressed.

Which version of stylelint are you using?

12.0.0

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

Node.js API

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

No

What did you expect to happen?

Warnings should be suppressed in quiet mode. Example:

$ npm run stylelint
/src/sass/_mixins.scss:101:2: Expected single space before "{" (block-opening-brace-space-before) [error]

1 problem

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

Warnings are not suppressed. Example:

$ npm run stylelint
/src/sass/_mixins.scss:101:2: Expected single space before "{" (block-opening-brace-space-before) [error]
/src/sass/_mixins.scss:234:18: Unexpected !important (declaration-no-important) [warning]
/src/sass/_mixins.scss:238:20: Unexpected !important (declaration-no-important) [warning]

3 problems
@alexander-akait
Copy link
Member

i think quiet option only for CLI

@jeddy3 jeddy3 changed the title The Quiet option doesn't work with Node API Add quiet option to Node API Jan 11, 2020
@jeddy3 jeddy3 added the status: needs discussion triage needs further discussion label Jan 11, 2020
@jeddy3
Copy link
Member

jeddy3 commented Jan 11, 2020

Is there any reason we don't allow it to be used by the Node API? If not, we could add it.

@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules and removed status: needs discussion triage needs further discussion labels Feb 11, 2020
@jeddy3
Copy link
Member

jeddy3 commented Feb 11, 2020

As it's a valid use case (where a user wants data.output to be filtered of errors when using the Node.js API) and there are no objections, I've labelled the issue as ready to implement. Please consider contributing if you have time.

You'll need to move quiet out from the CLI docs and into the Options docs in the pull request.

@glen-84
Copy link
Contributor

glen-84 commented Oct 31, 2021

@jeddy3 I think this should be closed? (#5542)

@jeddy3 jeddy3 closed this as completed Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules
Development

No branches or pull requests

4 participants