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

Factor in 'raw' configurations on top of 'reported' ones #245

Merged
merged 5 commits into from Oct 20, 2019

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Oct 20, 2019

PR Checklist

Overview

Before this change, find*Configuration functions for linters only returned the 'reported' config, meaning the CLI output of --print-config or similar. This change makes them return two things:

  • full: that reported configuration, considered to be the complete list of all original settings
  • raw: the naive results of importing the configuration file

The raw config is used to override some settings in the printed output, namely globals and extends, because ESLint prints way too many globals but none of the extends (#232).

A few tangential changes:

  • A new importer was necessary for importing .json files with comments.
  • Added root object key sorting to the output formatters, since they were getting a little oddly sorted from the raw overrides
  • Enabled esModuleInterop in tsconfig.json because strip-json-comments' types don't have a default export

Still to do:

  • Flesh out test coverage, especially for the new importer
  • Add some JSDoc comments around the more confusing areas... perhaps a .md addition?
  • Double-check this works locally (initial runs worked well!)

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author The PR author should address requested changes label Oct 20, 2019
@JoshuaKGoldberg JoshuaKGoldberg changed the title WIP: Factor in 'raw' configurations on top of 'reported' ones Factor in 'raw' configurations on top of 'reported' ones Oct 20, 2019
@JoshuaKGoldberg JoshuaKGoldberg merged commit b7945eb into master Oct 20, 2019
@JoshuaKGoldberg JoshuaKGoldberg deleted the raw-config-importing branch October 20, 2019 20:08
@JoshuaKGoldberg JoshuaKGoldberg removed the status: waiting for author The PR author should address requested changes label Oct 21, 2019
...rawConfiguration,
full: {
...defaultTSLintConfiguration,
...rawConfiguration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @JoshuaKGoldberg I noticed TSLint rule arguments are not being picked up in the latest release and I think the issue might be here. Should this be reportedConfiguration instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps! @jeremyyap would you mind filing an issue! I can take a look later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing extends in generated config
2 participants