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

no-unused-vars message does not end with a period #6738

Closed
wavebeem opened this issue Jul 22, 2016 · 5 comments
Closed

no-unused-vars message does not end with a period #6738

wavebeem opened this issue Jul 22, 2016 · 5 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@wavebeem
Copy link
Contributor

What version of ESLint are you using?

2.10.2

What parser (default, Babel-ESLint, etc.) are you using?

Default

Please show your full configuration:

const options = {
  // TODO: Actually set the envs correctly
  envs: ['browser', 'mocha', 'node', 'es6'],
  useEslintrc: false,
  extends: 'eslint:recommended',
  ignorePattern: [
    'node_modules',
    'bower_components',
    'build',
    'tmp',
    'dist'
  ],
  // Eventually let's enable it to fix problems automatically! :D
  // fix: true,
  rules: {
    semi: WARN,
    strict: [WARN, 'safe'],
    'no-undef': ERROR,
    'wrap-iife': WARN,
    'no-trailing-spaces': WARN,
    'comma-style': [WARN, 'last'],
    'new-parens': WARN,
    'no-inline-comments': WARN,
    'no-sequences': ERROR,
    'no-alert': WARN,
    'no-caller': WARN,
    'no-lone-blocks': WARN,
    'object-curly-spacing': [WARN, 'never'],
    'space-infix-ops': WARN,
    'space-unary-ops': [WARN, {words: true, nonwords: false}],
    'spaced-comment': [WARN, 'always'],
    'no-unused-vars': [WARN, {argsIgnorePattern: '^_'}]
  }
};

What did you do? Please include the actual source code causing the issue.

I linted code and got back a message without a period.

const cli = new eslint.CLIEngine(eslintOptions);

function lint(req, res) {
  if ('paths' in req.body) {
    const report = cli.executeOnFiles(req.body.paths);
    if (eslintOptions.fix) {
      eslint.CLIEngine.outputFixes(report);
    }
    res.json(report);
  } else {
    res.status(S.BAD_REQUEST).json({
      error: 'Missing parameter "path"'
    });
  }
}

What did you expect to happen?

I expected the message from the no-unused-vars rule to include a period at the end, like the other messages from ESLint.

What actually happened? Please include the actual, raw output from ESLint.

https://gist.github.com/wavebeem/98136a4d2823a43716e76651571473a6

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 22, 2016
wavebeem pushed a commit to wavebeem/eslint that referenced this issue Jul 22, 2016
The other rules in ESLint seem to end their messages with a period, but `no-unused-vars` doesn't, so this PR attempts to change that.
@markelog markelog added rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion bug ESLint is working incorrectly and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion triage An ESLint team member will look at this issue soon labels Jul 22, 2016
@platinumazure
Copy link
Member

platinumazure commented Jul 22, 2016

Just to avoid potential confusion for people who use the most common formatter, "stylish", it's worth noting that the "stylish" formatter explicitly strips periods off the end of messages. My opinion is that we should still end lint messages with periods in general, because most or all other formatters carry those through.

@wavebeem Thanks very much for the issue and for submitting a pull request to address!

EDIT: Confirmed in online demo, which does not strip periods from messages.

@wavebeem
Copy link
Contributor Author

@platinumazure Oh, that's a good thing to call out! I was wondering why this wasn't noticed sooner, and that makes sense. I found this while making a tool that wraps ESLint, so I might have to copy that approach of trimming final periods!

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 22, 2016
@nzakas
Copy link
Member

nzakas commented Jul 22, 2016

@wavebeem do you want to submit a PR for this?

@ilyavolodin
Copy link
Member

@nzakas #6739

@wavebeem
Copy link
Contributor Author

@nzakas I already have, but it needs some work still (#6739)

wavebeem pushed a commit to wavebeem/eslint that referenced this issue Jul 24, 2016
The other rules in ESLint seem to end their messages with a period, but `no-unused-vars` doesn't, so this PR attempts to change that.
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

6 participants