Skip to content

W-17599563 fix: use eslint 9 - #1673

Merged
cristiand391 merged 6 commits into
mainfrom
mdonnalley/eslint-9
Jan 28, 2025
Merged

cristiand391 merged 6 commits into
mainfrom
mdonnalley/eslint-9

Conversation

@mdonnalley

Copy link
Copy Markdown
Contributor

Use eslint 9 config

Depends on oclif/eslint-config-oclif#122

Fixes #1665
@W-17599563@

@jpshack-at-palomar

Copy link
Copy Markdown

@mdonnalley Thanks for working on this!

cristiand391
cristiand391 previously approved these changes Jan 27, 2025
@cristiand391

Copy link
Copy Markdown
Contributor

QA notes:

setup:
generated an ESM/CJS plugin with ./bin/run.js generate test-eslint, modified hello world command like this:

import {Command} from '@oclif/core'
import { EOL } from 'os'

export default class World extends Command {
  static args = {}
  static description = 'Say hello world'
  static examples = [
    `<%= config.bin %> <%= command.id %>
hello world! (./src/commands/hello/world.ts)
`,
  ]
  static flags = {}

  async run(): Promise<void> {
    console.log(EOL)

    this.log('hello world! (./src/commands/hello/world.ts)')
  }
}

✅ CJS/ESM plugins work with default eslint v9 config (yarn lint)

❌ missing prefer-node-protocol warning, the eslint-config-oclif PR is missing the unicorn/recommended rules:
https://github.com/oclif/eslint-config-oclif/blob/eb27b1ca77fee27253ff341d6dd926b1e7ae3801/index.js#L6

✅ eslint-plugin-mocha rules apply in tests

✅ no-unused-expressions disabled on test files
❓ : dangle-comma was deprecated on v8:
https://eslint.org/docs/latest/rules/comma-dangle

if we don't want to bring in another stylistic stuff maybe just remove it or see if prettier handles this?

ditto:
no-multi-spaces: https://eslint.org/docs/latest/rules/no-multi-spaces#rule-details
indent: https://eslint.org/docs/latest/rules/indent#rule-details
quotes: https://eslint.org/docs/latest/rules/quotes
semi: https://eslint.org/docs/latest/rules/semi

@cristiand391
cristiand391 merged commit 25c5d58 into main Jan 28, 2025
@cristiand391
cristiand391 deleted the mdonnalley/eslint-9 branch January 28, 2025 12:37
@iowillhoit iowillhoit changed the title fix: use eslint 9 W-17599563 fix: use eslint 9 Feb 10, 2025

@iowillhoit iowillhoit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LG

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.

oclif generate should use eslint 9 compatible templates

4 participants