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

Resolves JS-278 #4769

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Resolves JS-278 #4769

merged 2 commits into from
Aug 22, 2024

Conversation

ericmorand-sonarsource
Copy link
Contributor

@ericmorand-sonarsource ericmorand-sonarsource commented Aug 20, 2024

Fixes JS-278

Please read the commit messages for more information.

Also, this may seem like a big change according to the number of files changed, but around 440 of these files are Java Check subclasses where the eslintKey public getter was removed. You can safely ignore them and focus on the 20 or so relevant changes that this PR brings.

This commit removes the concept of ESLint key from the backend.

The rational is that the usage of ESLint is an implementation detail of the frontend that must not propagate
to the other layers: would we want to totally change the way the frontend detect issues, the backend should
not be impacted at all.

Rationality aside, this change removes the requirements of maintaining a mapping between the ESLint keys and
their RSpec counterparts, which will make our life easier in the future.

Java checks now have RSpec identifiers only. To preserve compatiblity with potential
plugins that depend on this one, the semantic `eslintKey` was left untouched, but now means
"RSpec identifier". Only the tests that contained the rule key in their expectation have been updated.
Other tests, and especially ruling tests, were left untouched.

A word about the ESLint plugin: in order to not break the public contract of the ESLint plugin that
is also built from the frontend code, the ESLint keys have been kept in the rules entry point.
Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

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

LGTM, very nice Eric! thx!

some small comments, from what we discussed you can focus on the quickfixes test and ignore the others.

packages/jsts/tests/linter/wrapper.test.ts Outdated Show resolved Hide resolved
packages/jsts/tests/rules/index.test.ts Outdated Show resolved Hide resolved
* Remove the "number of rules in public API" test entirely
* Improve the Linter Wrapper test to ignore only SXXX fixtures instead of being super permissive
* Remove the unneeded and confusing `@Rule` annotation on TestFileCheck abstract class
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
1 New issue
52.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@ericmorand-sonarsource ericmorand-sonarsource merged commit a9a8c41 into master Aug 22, 2024
14 of 16 checks passed
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