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

New: noInlineConfig setting (refs eslint/rfcs#22) #12091

Merged
merged 5 commits into from Aug 18, 2019
Merged

Conversation

mysticatea
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Add something to the core

What changes did you make? (Give an overview)

This PR implements a part of eslint/rfcs#22, noInlineConfig setting.

Also, this PR fixes a bug that --no-inline-config didn't disable eslint-env comments.

Is there anything you'd like reviewers to focus on?

Nothing in particular.

@mysticatea mysticatea added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint labels Aug 12, 2019
@mysticatea
Copy link
Member Author

I'm not sure why commit-message failed.

@aladdin-add
Copy link
Member

I think it's failing just as it does not support fixing cross-repo issue. :)

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

lib/linter/linter.js Outdated Show resolved Hide resolved
tests/lib/linter/linter.js Show resolved Hide resolved
mysticatea and others added 3 commits August 13, 2019 11:15
Co-Authored-By: Kevin Partington <platinum.azure@kernelpanicstudios.com>
@@ -1019,7 +1042,9 @@ class Linter {
}

// search and apply "eslint-env *".
const envInFile = findEslintEnv(text);
const envInFile = options.allowInlineConfig && !options.warnInlineConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find 👍

@mysticatea
Copy link
Member Author

I have updated this PR.

  • Fix typo
  • Add tests for line comments
  • Add config name what noInlineConfig came from

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! (Left one question but it's not a blocker.)

"eslint-enable eqeqeq",
"eslint-env es6"
]) {
// eslint-disable-next-line no-loop-func
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why does no-loop-func think there is a problem here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably due to linter variable. It's shared in the callback in this loop.

@platinumazure
Copy link
Member

I think we can merge this (even with the commit-message status message, since that's due to a limitation in eslint-github-bot), but I am unable to merge from my phone.

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for working on this!

@manovotny
Copy link
Contributor

Should there be a follow up issue to document noInlineConfig? I don't see it on the Configuring ESLint page.

@platinumazure
Copy link
Member

Should there be a follow up issue to document noInlineConfig? I don't see it on the Configuring ESLint page.

Probably. Issue and/or PR would be welcome!

@mysticatea
Copy link
Member Author

I also found the missing of docs, then I have added it while #12151.

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 core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants