Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

yoshinorin
Copy link
Member

@yoshinorin yoshinorin commented Apr 22, 2025

What does it do?

I'm sorry for not noticing during my review of #5599 that the test directory was excluded from linting. This PR makes the following changes:

  1. Add the test directory to eslint scope.
  2. Manage the rules for both lib and test directories in a single eslint.config.js file at the root.
    a. During the review of chore: update eslint warehouse#286, I noticed that placing an eslint.config.js in the test directory has no effect.

Screenshots

N/A

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

Copy link

How to test

git clone -b chore/apply-lint-to-test https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Apr 22, 2025

Pull Request Test Coverage Report for Build 15158240756

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.526%

Totals Coverage Status
Change from base Build 14851402685: 0.0%
Covered Lines: 9859
Relevant Lines: 9906

💛 - Coveralls

'test/**/*.ts'
],
languageOptions: {
...testConfig.languageOptions
Copy link
Member Author

Choose a reason for hiding this comment

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

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': [
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this is for tests, we might consider ignoring all no-unused-vars.

...testConfig.languageOptions
},
rules: {
...testConfig.rules,
Copy link
Member Author

Choose a reason for hiding this comment

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

Also here

test/scripts/hexo/post.ts Outdated Show resolved Hide resolved
yoshinorin and others added 2 commits May 21, 2025 17:11
Co-authored-by: Shuqiao Zhang <1119186082@qq.com>
Signed-off-by: yoshinorin <yoshinorin.net@outlook.com>
@stevenjoezhang stevenjoezhang force-pushed the chore/apply-lint-to-test branch from 6938c0c to f173676 Compare May 21, 2025 09:11
@stevenjoezhang stevenjoezhang merged commit 8ae7aa8 into master May 21, 2025
17 checks passed
@stevenjoezhang stevenjoezhang deleted the chore/apply-lint-to-test branch May 21, 2025 09:20
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.