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.

Using `CLIEngine` Options for Defining a Configuration are not Fully Explained in the Docs.

See original GitHub issue

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)

{
  'parserOptions': {
    'ecmaVersion': 6,
    'ecmaFeatures': {
        'jsx': true,
        'impliedStrict': true
    },
    env: {
      'es6': true,
      'node': true,
      'mocha': true,
      'browser': true
    },
    rules: {
      // all rules are included
    }
}

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.* or eslintConfig 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 are configFile, baseConfig and useSpecificConfig.

Can anyone validate that these are the expected results?

  1. baseConfig has lower precedence than project root .eslintrc.* file (including descendent .eslintrc.* files). Therefore, the object passed to baseConfig can be extended (this not addressed in Configuration Cascading and Hierarchy)?
  2. baseConfig does not satisfy the “requires configuration to run” rule.
  3. useSpecificConfig does not satisfy the “requires configuration to run” rule (the opposite is stated in Requiring Configuration to Run).
  4. 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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
platinumazurecommented, Jul 8, 2016

Alright folks, I’ll work on this. Here’s how I’m going to do this:

  1. Create a PR to fix the currently inaccurate migration guide docs (remove useSpecificConfig).
    • This is found here: #6618
  2. Create a PR to allow baseConfig as a configuration and add that information to the migration guide.
    • This is found here: #6625

Let me know if there are any questions or concerns with this approach.

0reactions
platinumazurecommented, Jul 8, 2016

@nzakas Now that #6618 is merged, I should be able to open the second PR today or tonight. I’ve already committed the changes to a branch.

EDIT: This is done, see #6625.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Configuration Files - App Engine - Google Cloud
Each service's configuration file defines the scaling type and instance class for a specific service/version.
Read more >
ESLint not working in VS Code? - Stack Overflow
VSCode would not recognize module aliases defined in my Webpack config file and was displaying Eslint errors but running Eslint from the command ......
Read more >
How to format ESLint output. Playing with CLIEngine API
Be aware that options which are not supported by CLIEngine constructor should be defined as a baseConfig property. Check documentation for ...
Read more >
How to use ESLint with TypeScript | Khalil Stemmler
ESLint is a JavaScript linter that you can use to lint either ... error 'console' is not defined no-undef 4:1 error loops are...
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