question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: `capitalized-comments` yelling about an inline comment

See original GitHub issue

Tell us about your environment

Environment Info:

Node version: v14.0.0
npm version: v6.14.4
Local ESLint version: v6.8.0 (Currently used)
Global ESLint version: Not found

What parser (default, Babel-ESLint, etc.) are you using? @typescript-eslint/parser

Please show your full configuration:

Configuration
module.exports = {
  root: true,

  parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
  parserOptions: {
    // Enable linting rules with type information from our tsconfig
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.eslint.json'],

    sourceType: 'module', // Allow the use of imports / ES modules

    ecmaFeatures: {
      impliedStrict: true, // Enable global strict mode
    },
  },

  // Specify global variables that are predefined
  env: {
    node: true, // Enable node global variables & Node.js scoping
    es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
  },

  plugins: [
  ],

  extends: [
    '@xpring-eng/eslint-config-base',
  ],
  rules: {},
  overrides: [],
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const example = {
  nonce: 'abc', // a numeric string
}
eslint . --ext .ts

What did you expect to happen? I expected to not get a warning on an uncapitalized inline comment.

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

  55:7   warning  Variable 'example' is declared but its value is never read. Allowed unused names must match /^_/  @typescript-eslint/no-unused-vars-experimental
  55:7   warning  'example' is assigned a value but never used. Allowed unused vars must match /^_/u                @typescript-eslint/no-unused-vars
  56:17  warning  Comments should not begin with a lowercase character                                              capitalized-comments

Are you willing to submit a pull request to fix this bug?

Yes, with some guidance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
anikethsahacommented, May 30, 2020

Can this be open ? this issue seems reasonable

1reaction
anikethsahacommented, Apr 28, 2020

No worries! This would be changing the behavior of the rule (and then updating the docs!).

cool, yes I think this will be good change 👍

May be this is an enhancement instead of bug cause currently, the rule is working as intended 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

capitalized-comments - ESLint - Pluggable JavaScript Linter
Setting the ignoreInlineComments option to true means that comments in the middle of code (with a token on the same line as the...
Read more >
All caps - Wikipedia
In typography, all caps (short for "all capitals") refers to text or a font in which all letters are capital letters, for example:...
Read more >
Ruby Style Guide
Use one space between the leading # character of the comment and the text of the comment. English Syntax. Comments longer than a...
Read more >
How should I style my code comments for optimal readability ...
I tend to capitalize certain terms so I can find them throughout the code base like “TODO:” and “BUGFIX:”. Other than that, I...
Read more >
Inline comment is broken if a page contains a link to ... - Jira
We have this issue to often to consider inline comments as a stable feature. Sometimes I get the error on one word and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found