Skip to content

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

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

Closed
aladdin-add opened this issue Jun 20, 2021 · 2 comments · Fixed by #329

Comments

@aladdin-add
Copy link
Contributor

> 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 15ffada. it would be great if we can find a way to avoid the warnings. :)

@bmish
Copy link
Member

bmish commented Jun 20, 2021

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.

@aladdin-add
Copy link
Contributor Author

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 added a commit that referenced this issue Nov 17, 2022
… the docs

as inline configs was widely used in the source code, I just separate
the `eslint --no-inline-config docs` to npm script `lint:docs`.

fixes #140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants