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.

Conflicts `eslint-disable` comments with ESLint's `spaced-comment` rule

See original GitHub issue

Is your feature request related to a problem? Please describe. It looks like the comment node are extracted here: https://github.com/B2o5T/graphql-eslint/blob/4bcee4a7849602076fb9e0d9ab33e78141e20a8e/packages/plugin/src/estree-converter/utils.ts#L109 but since the API conforms to the SourceLocation type from estree, there’s no actual comment field exposed.

Therefore it’s not possible to disable a rule on a per field basis.

Describe the solution you’d like Expose the comment field to the Node type: https://github.com/B2o5T/graphql-eslint/blob/c33bde9c1c5bd8aa780a8ef6c1737eaaaa95f3b0/packages/plugin/src/estree-converter/types.ts#L106-L116

This way we can detect the comment on a field like https://github.com/relayjs/eslint-plugin-relay/blob/main/src/utils.js#L111-L114 which lets us disable a rule on a field level.

Describe alternatives you’ve considered n/a

Additional context n/a

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
B2o5Tcommented, Oct 11, 2022

@shogunsea I reopened your issue to figure out why there are conflicts with spaced-comment rule when I’ll have a time

0reactions
taejscommented, Nov 17, 2022
type TEST {
  _id: ID! # eslint-disable-line @graphql-eslint/naming-convention
type TEST {
  _id: ID! #eslint-disable-line @graphql-eslint/naming-convention

The error occurs when comments are written without a space in the schema (Second one)

Read more comments on GitHub >

github_iconTop Results From Across the Web

spaced-comment - ESLint - Pluggable JavaScript Linter
This rule will enforce consistency of spacing after the start of a comment // or /* . It also provides several exceptions for...
Read more >
Lint unnecessary disabled reporting comments #6190 - GitHub
This plugin includes 6 rules to use ESLint directive-comments (e.g. /*eslint-disable*/ ) correctly. One of them is inspired by above GitHub's ...
Read more >
Turning off eslint rule for a specific line - Stack Overflow
From Configuring ESLint - Disabling Rules with Inline Comments: ... The general end of line comment, // eslint-disable-line , does not need ...
Read more >
List of available rules - ESLint - Pluggable JavaScript linter
No rules are enabled by default. The "extends": "eslint:recommended" property in a configuration file enables rules that report common problems, ...
Read more >
Changelog - JavaScript Standard Style
If you have used comments like // eslint-disable-line node/no-deprecated-api you ... Relax rule: JSX: Remove conflicting indentation rule in indent #1499 ...
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