Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a problem that 3rd-party plugins could not be loaded with legacy config #366

Merged
merged 8 commits into from
Sep 26, 2024

Conversation

mizdra
Copy link
Owner

@mizdra mizdra commented Sep 25, 2024

close: #364

Comment on lines 73 to 82
"// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
// eslint-disable-next-line test/ban-nullish-coalescing-operator
Copy link
Owner Author

Choose a reason for hiding this comment

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

I was expecting only one disable comment to be added, but multiple ones were added.

To investigate this problem, I added the following code for the debug log.

$ pnpm run test -t "fixes problems" src/core.test.ts
...
unfilteredMessages [
  {
    ruleId: 'test/ban-nullish-coalescing-operator',
    message: "Definition for rule 'test/ban-nullish-coalescing-operator' was not found.",
    line: 1,
    column: 1,
    endLine: 1,
    endColumn: 2,
    severity: 2,
    nodeType: null
  }
]

It seems that the plugin is failing to load.

Copy link
Owner Author

Choose a reason for hiding this comment

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

core.lint() only uses the ESLint class. On the other hand, core.disablePerLine() uses both the ESLint class and the Linter class.

The ESLint class seems to be able to load 3rd-party plugins, but the Linter class cannot.

As a result, it seems that although the lint results can be output, the problems cannot be fixed.

@mizdra mizdra marked this pull request as ready for review September 25, 2024 15:07
@mizdra mizdra merged commit 01b0b5b into main Sep 26, 2024
26 checks passed
@mizdra mizdra deleted the fix-problems-with-legacy-config-and-3rd-party-plugin branch September 26, 2024 16:10
@mizdra mizdra added the Type: Bug Bug or Bug fixes label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot save fixes when using legacy config (eslintrc) and typescript-eslint
1 participant