Skip to content

Conversation

YasharF
Copy link
Contributor

@YasharF YasharF commented Aug 10, 2025

Dependabot was unable to auto-merge @wdio/eslint updates due to lint rule changes. This commit manually bumps the version and resolves indentation and formatting issues required by the new config.

Copy link
Contributor

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Same here, the formatting of the types seems off, was this autogenerated?

@YasharF
Copy link
Contributor Author

YasharF commented Aug 11, 2025

Yes autogenerated with npm run test:lint -- --fix.

I see the issue that you are pointing to though, so I did some digging and this is what I figured out as the cause and the potential solution:

@wdio/eslint 0.0.5 used ESLint's core indent rule, which ignores comments entirely. In other words JSDoc blocks weren't linted or auto-fixed. In 0.1.2, the config switched to @stylistic/indent, which does enforce indentation on the opening /** and closing */ lines of comment blocks, but skips the inner * lines. That's why eslint --fix made the JSDoc blocks to look misaligned (the outer lines are linted, but the content stayed unchecked.)

A good long-term fix would be to add eslint-plugin-jsdoc to @wdio/eslint, along with some minor adjustment to its defaults so we can adopt it with fairly low effort. That way, JSDoc blocks are linted consistently and auto-fixed properly. I can open a PR to @wdio/eslint for this if helpful. Let me know.

I am thinking about a change like the following for @wdio/eslint:

import jsdoc from 'eslint-plugin-jsdoc'   <--- new
...
extends: [
  wdioPlugin['flat/recommended'],
  jsdoc.configs['flat/recommended']   <--- new
],
...
plugins: {
  unicorn,
  'unused-imports': unusedImports,
  '@stylistic': stylistic,
  jsdoc,   <--- new
},
...
settings: {   <--- new
  jsdoc: {   <--- new
    mode: 'typescript'   <--- new
  }   <--- new
},   <--- new
...
rules: {
...
  'jsdoc/check-alignment': 'error',   <--- new
  'jsdoc/require-jsdoc': 'warn',   <--- new
}

We'll still need to adjust some formatting in node-geckodriver and node-edgedriver, but without lint rules for JSDoc blocks we are going to have to manually check those comment blocks for misalignments.

@YasharF
Copy link
Contributor Author

YasharF commented Aug 11, 2025

I think another option might be to just drop the style lint rules, and add prettier and have it format the blocks and such. That can potentially resolve webdriverio/eslint#30 as well. I can work on PRs for this option as well if you like.

@YasharF YasharF marked this pull request as draft August 17, 2025 17:49
@YasharF
Copy link
Contributor Author

YasharF commented Aug 17, 2025

I manually added indentations to make them look right. Future manual work is probably not going to be needed once webdriverio/eslint#30 is resolved.

Dependabot was unable to auto-merge @wdio/eslint updates due to lint rule changes. This commit manually bumps the version and resolves indentation and formatting issues required by the new config.
@YasharF
Copy link
Contributor Author

YasharF commented Aug 17, 2025

Rebased to resolve conflicts

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.

2 participants