-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Using CLIEngine
Options for Defining a Configuration are not Fully Explained in the Docs.
#6605
Comments
Both |
From http://eslint.org/docs/user-guide/migrating-to-3.0.0#requiring-configuration-to-run
Am I misunderstanding? What is |
Leaving a comment to note I'm tracking this. When get to a PC, I'll try to reproduce. |
Loading my configuration via an object passed to {
'useSpecificConfig': true,
'parserOptions': {
'ecmaVersion': 6,
'ecmaFeatures': {
'jsx': true,
'impliedStrict': true
},
env: {
'es6': true,
'node': true,
'mocha': true,
'browser': true
},
rules: {
// all rules are included
}
} |
As @nzakas noted, @ryanfitzer For your use case, if you want to just use a passed in configuration, you need to specify On the one hand, it's a pain to have to add a new option when invoking CLIEngine in this way. On the other hand, pre-3.0.0 your ESLint invocations were wasting cycles trying to find a config file that you probably knew didn't exist. 😄 Try adding |
This indeed allows the Is there any design reason that To add to the confusion, the |
No design decision- I just didn't account for baseConfig. Can you please explain what other way you want to extend your baseConfig
|
I actually do want to use an eslintrc file, just not one in the project root. I have eslintrc files in the project's nested folders, just not a top-level one in the root. |
Regarding:
The condition in lib/config.js makes it clear that this is an internal property used for when a Looks like the 4th option in the Requiring Configuration to Run section is just a duplicate of the 3rd option. |
Okay, then I think we have at least two issues. One, baseConfig should be sufficient to avoid throwing the no config found exception. Two, the migration guide needs to be tweaked. @ryanfitzer Am I missing anything? |
I also noticed that the |
@ryanfitzer I think so but I'm not 100% sure on that one. It does seem redundant given the ability to use |
In the Configuration Cascading and Hierarchy section, the |
Sorry, clearly I was a bit overtired when I wrote the migration guide, @platinumazure agree with the two problems you mentioned. |
Alright folks, I'll work on this. Here's how I'm going to do this:
Let me know if there are any questions or concerns with this approach. |
@platinumazure sounds good. Do you have an ETA? |
What version of ESLint are you using?
eslint v3.0.0
What parser (default, Babel-ESLint, etc.) are you using?
default parser
Please show your full configuration:
(loaded via the
CLIEngine
options)What did you do? Please include the actual source code causing the issue.
I'm trying to correctly configure the
CLIEngine
in a project without a root .eslintrc.* oreslintConfig
property in package.json, but does contain a nested .eslintrc.* file. From what I understand from the docs, the 3 available options for my scenario areconfigFile
,baseConfig
anduseSpecificConfig
.Can anyone validate that these are the expected results?
baseConfig
has lower precedence than project root .eslintrc.* file (including descendent .eslintrc.* files). Therefore, the object passed tobaseConfig
can be extended (this not addressed in Configuration Cascading and Hierarchy)?baseConfig
does not satisfy the "requires configuration to run" rule.useSpecificConfig
does not satisfy the "requires configuration to run" rule (the opposite is stated in Requiring Configuration to Run).useSpecificConfig
only accepts an object (this option is not documented in the CLIEngine section).What did you expect to happen?
a. I expected
useSpecificConfig
to satisfy the "requires configuration to run" rule.b. I expected to ascertain the precedence of
useSpecificConfig
since it's not documented.c. I expected that
baseConfig
would satisfy the "requires configuration to run" rule as it represents a configuration.What actually happened? Please include the actual, raw output from ESLint.
The opposite results of what is stated in points a, b and c above.
The text was updated successfully, but these errors were encountered: