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

[base] use env flags to config severity level #1037

Closed
wants to merge 1 commit into from
Closed

Conversation

hshoff
Copy link
Member

@hshoff hshoff commented Aug 26, 2016

Best viewed ignoring whitespace: https://github.com/airbnb/javascript/pull/1037/files?w=1
addressing: #1015

⚠️ WIP... just looking for implementation feedback.

Currently it just reads from process.argv and parses out severity level flags. Flag options: --warn, --off, --error.

Usage would be from the command line like --warn=some-rule,another-rule --off=semi

Not positive if this is the best way to control severity levels. Would prefer to have this as a field in .eslintrc called overrides or something. Open to other ideas.

before:

$ node
> require('./best-practices')
    rules: {
      'accessor-pairs':  'off',
      'array-callback-return': 'error',
      'block-scoped-var':  'error',
// ...

after:

$ node
> process.argv.push('', "--warn=accessor-pairs", "--off=block-scoped-var")
4
> require('./best-practices')
{ rules:
   { 'accessor-pairs': 'warn',
     'array-callback-return': 'error',
     'block-scoped-var': 'off',
// ...

@ljharb @lencioni

@ljharb
Copy link
Collaborator

ljharb commented Aug 26, 2016

I'm not sure if this is the approach we want.

Primarily, I don't think we want per-rule granularity - override comments are best for those. I'm going to close this; but let's discuss this in person.

@ljharb ljharb closed this Aug 26, 2016
@ljharb ljharb deleted the harry-env-sev branch August 26, 2016 06:32
@hshoff
Copy link
Member Author

hshoff commented Aug 26, 2016

👍

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

Successfully merging this pull request may close these issues.

2 participants