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

feat(linter): eslint-plugin-unicorn/prefer-prototype-methods #1660

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

haocheng6
Copy link
Contributor

This PR implements the eslint-plugin-unicorn/prefer-prototype-methods rule.

Tests taken from https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/prefer-prototype-methods.mjs.

Related issue: #684

I added a "TODO" comment in the code because it looks like we don't have a utility function similar to getPropertyName (which uses getStaticValue under the hood) in @eslint-community/eslint-utils yet. I will try to implement the function sometime if no one else is working on it.

@github-actions github-actions bot added the A-linter Area - Linter label Dec 12, 2023
Copy link

codspeed-hq bot commented Dec 12, 2023

CodSpeed Performance Report

Merging #1660 will not alter performance

⚠️ No base runs were found

Falling back to comparing haocheng6:684-prefer-prototype-methods (3145042) with main (90524c8)

Summary

✅ 20 untouched benchmarks

@Dunqing
Copy link
Member

Dunqing commented Dec 13, 2023

Thank you for your contribution!

It looks like you are creating new rules manually. If you want to create a new rule you can run just new-unicorn-rule prefer-prototype-methods. The rule file will automatically created

@Dunqing Dunqing enabled auto-merge (squash) December 14, 2023 01:31
@Dunqing Dunqing merged commit c9589b5 into oxc-project:main Dec 14, 2023
16 checks passed
@haocheng6 haocheng6 deleted the 684-prefer-prototype-methods branch December 14, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants