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.

Missing extends in generated config

See original GitHub issue

🐛 Bug Report

  • tslint-to-eslint-config version: 0.2.7
  • ESLint version: 6.5.1
  • Node version: 12.10.0

Actual Behavior

extends is an empty array in the output even if there were extends in the original .eslintrc

Expected Behavior

The extends in the original .eslintrc should be retained

Reproduction

Original .eslintrc.js:

module.exports = {
  extends: ["airbnb"]
}

Output using ESLint 5:

module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": [
        ".../node_modules/eslint-config-airbnb-base/rules/best-practices.js",
        ".../node_modules/eslint-config-airbnb-base/rules/errors.js",
        ".../node_modules/eslint-config-airbnb-base/rules/node.js",
        ".../node_modules/eslint-config-airbnb-base/rules/style.js",
        ".../node_modules/eslint-config-airbnb-base/rules/variables.js",
        ".../node_modules/eslint-config-airbnb-base/rules/es6.js",
        ".../node_modules/eslint-config-airbnb-base/rules/imports.js",
        ".../node_modules/eslint-config-airbnb-base/rules/strict.js",
        ".../node_modules/eslint-config-airbnb-base/index.js",
        ".../node_modules/eslint-config-airbnb/rules/react.js",
        ".../node_modules/eslint-config-airbnb/rules/react-a11y.js",
        "airbnb"
    ],
    ...
};

Output using ESLint 6:

module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": [],
    ...
};

It seems that the behaviour of the --print-config flag changed in ESLint 6 and it no longer prints extends

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshuaKGoldbergcommented, Oct 20, 2019

@jeremyyap #245 is merged in now, but if you think there’s a flaw in its logic or have a better solution, I’m all ears! We can either re-open this issue or file a new one.

1reaction
jeremyyapcommented, Oct 14, 2019

I dug into this and came up with a working solution: https://github.com/jeremyyap/tslint-to-eslint-config/commit/67c0b158b7d68a04d3b1712c7d6ca0f468cd0910

Admittedly it’s quite a hacky solution but this is the only one I found so far besides just copying over the file parsing code from ESLint. I needed to use rewire as the functionality we need is not exposed by ESLint, not even exported by the file it’s in.

https://github.com/eslint/eslint/blob/97045ae0805e6503887eef0b131dcb9e70b6d185/lib/cli-engine/config-array-factory.js#L248-L266

On the plus side though, this will also solve #58 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why tailwind key is missing? - Stack Overflow
warn - The content key is missing or empty. Please populate the content key as Tailwind generates utilities on-demand based on the files ......
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
The extends property value can be an absolute or relative path to a base configuration file. ESLint resolves a relative path to a...
Read more >
Configuring EAS Build with eas.json - Expo Documentation
eas.json is the configuration file for EAS CLI and services. ... Build profiles can extend another build profile using the "extends" key.
Read more >
Content Configuration - Tailwind CSS
If Tailwind isn't generating classes, make sure your content configuration is correct and matches all of the right source files. A common mistake...
Read more >
catkin config – Configure a Workspace
Normally, a catkin workspace automatically “extends” the other workspaces that ... catkin CMake package, since this package is used to generate setup files....
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