Skip to content

Conversation

@stevenjoezhang
Copy link
Member

What does it do?

See hexojs/eslint-config-hexo#64

Screenshots

Pull request tasks

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

@github-actions
Copy link

How to test

git clone -b eslint https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test

@uiolee

This comment was marked as outdated.

@yoshinorin
Copy link
Member

@uiolee
If we apply the settings on below comments, these problems will be solved.
#5599 (comment)
#5599 (comment)

@uiolee
Copy link
Member

uiolee commented Jan 2, 2025

about "n/no-missing-import", full path is required. Maybe we need change our code style.

eslint-community/eslint-plugin-n#382

image
image

@coveralls
Copy link

coveralls commented Mar 8, 2025

Pull Request Test Coverage Report for Build 14560644494

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.526%

Totals Coverage Status
Change from base Build 13724198073: 0.0%
Covered Lines: 9872
Relevant Lines: 9919

💛 - Coveralls

@stevenjoezhang stevenjoezhang marked this pull request as draft March 16, 2025 15:42
@stevenjoezhang stevenjoezhang marked this pull request as ready for review April 19, 2025 15:55
@stevenjoezhang
Copy link
Member Author

I made some updates, ESLint no longer throws errors now.
But, I’ve added quite a few eslint-disable-next-line @typescript-eslint/no-unused-vars comments. Feel free to take a look and see if there's a better solution.

@yoshinorin
Copy link
Member

yoshinorin commented Apr 20, 2025

Feel free to take a look and see if there's a better solution.

How about adding a _ prefix to unused arguments and configuring eslint.config.js to ignore variables that start with _?
https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern

const config = require('eslint-config-hexo/ts');

module.exports = [
  ...config,
  {
    'rules': {
      '@typescript-eslint/no-explicit-any': 0,
      '@typescript-eslint/no-var-requires': 0,
      '@typescript-eslint/no-require-imports': 0,
      'n/no-missing-require': 0,
      'n/no-missing-import': 0,
+      "@typescript-eslint/no-unused-vars": [
+       "error",
+        {
+          "argsIgnorePattern": "^_"
+        }
+      ]
    }
  }
];
-  // eslint-disable-next-line @typescript-eslint/no-unused-vars
-  run(context, args, body, callback) {
+  run(context, args, _body, _callback) {
    return this._run(context, args, '');
  }

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@stevenjoezhang stevenjoezhang merged commit a18e974 into master Apr 21, 2025
24 checks passed
@stevenjoezhang stevenjoezhang deleted the eslint branch April 21, 2025 14:26
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.

6 participants