eslint-plugin-eslint-plugin icon indicating copy to clipboard operation
eslint-plugin-eslint-plugin copied to clipboard

warning '/*eslint*/' has no effect because you have 'noInlineConfig' setting in your config (.eslintrc.js#overrides[3])

Open aladdin-add opened this issue 4 years ago • 2 comments

> eslint . --ignore-pattern "!.*"


/home/weiran/repo/eslint-plugin-eslint-plugin/docs/rules/consistent-output.md
  16:1  warning  '/*eslint*/' has no effect because you have 'noInlineConfig' setting in your config (.eslintrc.js#overrides[3])
  37:1  warning  '/*eslint*/' has no effect because you have 'noInlineConfig' setting in your config (.eslintrc.js#overrides[3])

it was introduced in https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/commit/15ffadae375f9f835b3f3a18b5aa1bbc07e5efbe. it would be great if we can find a way to avoid the warnings. :)

aladdin-add avatar Jun 20 '21 04:06 aladdin-add

Here's why I had to enable noInlineConfig for the markdown documentation samples with these inline configs:

/* eslint eslint-plugin/consistent-output: error */
  1. We can only refer to our own rules using self/, not eslint-plugin/, so we'll get an error Definition for rule was not found.
  2. Even if we change the inline configs to use self/, then we will start receiving a lot of unwanted violations from the violations we intend to show in the documentation samples.

I'm not sure how to eliminate the warnings / noInlineConfig usage, other than to remove the inline configs (which I personally see as redundant, and note that we're not using them in every rule doc anyway).

Let me know if you have any ideas.

bmish avatar Jun 20 '21 16:06 bmish

uh, I have tried reportUnusedDisableDirectives: false, but it did not help.

there are some choices:

    1. remove the inline config in docs.
    1. eslint provide an option ignoreInlineConfig(similar to noInlineConfig).

I slightly prefer the 2nd(to keep the same format as eslint docs as possible, see for-direction). can you file the issue in eslint repo, so we can figure out the right solution?

aladdin-add avatar Jun 21 '21 00:06 aladdin-add