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:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
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 😅