Skip to content

NEW: @W-15884468@: Implement eslint engine's describeRules method #37

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

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

stephen-carter-at-sf
Copy link
Collaborator

@stephen-carter-at-sf stephen-carter-at-sf commented Jul 1, 2024

No description provided.

}
}

function toSeverityLevel(metadata: Rule.RuleMetaData, status: ESLintRuleStatus | undefined): SeverityLevel {
Copy link
Contributor

Choose a reason for hiding this comment

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

This has some convoluted matching logic here. Would really help to have some comments as to why we are doing this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure... will do. Note that our eslint engine design doc contains more info: https://docs.google.com/document/d/13M9nhS4tkhendq-9mRelnqP_rGU322mP7X0Ncxu-7Fs/edit#heading=h.uvab9trr4ep7

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, added in comments.

return this.ruleStatuses;
}

private async calculateRuleStatusesFor(files: string[], legacyESLint: ESLint): Promise<Map<string, ESLintRuleStatus>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be the only method that changes with eslint 9? I'm trying to understand how much of this would change with config changes in eslint 9.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The new flat config files (also available in eslint 8) will indeed require us to use the loadESLint utility to get a new ESLint constructor that is for flat configuration files. Therefore we will need to:

  • Construct our base configs off of the new flat config structure
  • Construct the ESLint instance from loadESLint instead of manually constructing the legacy one
  • And the biggest one will be... in order to get metadata for the rules, we'll need to import and process all of the users configuration files and the import and process all of the plugin modules that we find along the way to get access to the rule metadata.

@stephen-carter-at-sf stephen-carter-at-sf force-pushed the sf/W-15884468 branch 3 times, most recently from 8a88f99 to 8854cf2 Compare July 2, 2024 15:51
@stephen-carter-at-sf stephen-carter-at-sf force-pushed the sf/W-15884468 branch 2 times, most recently from 93d8855 to cad18ad Compare July 2, 2024 17:53
@stephen-carter-at-sf stephen-carter-at-sf merged commit f54660a into dev Jul 2, 2024
5 checks passed
@stephen-carter-at-sf stephen-carter-at-sf deleted the sf/W-15884468 branch July 2, 2024 17:57
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.

3 participants