chore(lint): apply eslint to test files#5655
Merged
stevenjoezhang merged 2 commits intomasterfrom May 21, 2025
Merged
Conversation
How to testgit clone -b chore/apply-lint-to-test https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test |
Pull Request Test Coverage Report for Build 15158240756Details
💛 - Coveralls |
yoshinorin
commented
Apr 22, 2025
| 'test/**/*.ts' | ||
| ], | ||
| languageOptions: { | ||
| ...testConfig.languageOptions |
Member
Author
There was a problem hiding this comment.
This approach is not preferable since it requires knowledge of what objects testConfig contains. However, I cannot think of a more appropriate method.
| ...testConfig.rules, | ||
| '@typescript-eslint/ban-ts-comment': 0, | ||
| '@typescript-eslint/no-unused-expressions': 0, | ||
| '@typescript-eslint/no-unused-vars': [ |
Member
Author
There was a problem hiding this comment.
Since this is for tests, we might consider ignoring all no-unused-vars.
| ...testConfig.languageOptions | ||
| }, | ||
| rules: { | ||
| ...testConfig.rules, |
2 tasks
Co-authored-by: Shuqiao Zhang <1119186082@qq.com> Signed-off-by: yoshinorin <yoshinorin.net@outlook.com>
6938c0c to
f173676
Compare
stevenjoezhang
approved these changes
May 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
I'm sorry for not noticing during my review of #5599 that the
testdirectory was excluded from linting. This PR makes the following changes:testdirectory to eslint scope.eslint.config.jsfile at the root.a. During the review of chore: update eslint warehouse#286, I noticed that placing an
eslint.config.jsin thetestdirectory has no effect.Screenshots
N/A
Pull request tasks