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

Can't run lint:fix script to resolve lint error #32350

Closed
kazrael2119 opened this issue Dec 24, 2024 · 4 comments
Closed

Can't run lint:fix script to resolve lint error #32350

kazrael2119 opened this issue Dec 24, 2024 · 4 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. eslint plugin

Comments

@kazrael2119
Copy link
Contributor

Here is the error message when running lint:fix script in latest main
Image

repro steps:

1: cd sdk/documentintelligence/ai-document-intelligence-rest/
2: rush update && rush build -t @azure-rest/ai-document-intelligence
3: rushx lint:fix

this issue has happened recently, Three weeks ago, in my refresh pr, I submitted a commit to fix lint error in 634fbea, at that time, lint:fix was useable.

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 24, 2024
@MaryGao
Copy link
Member

MaryGao commented Dec 24, 2024

@jeremymeng is this expected? Previously we could leverage lint:fix to fix linting issues but now it reported errors directly even there is no error if we run lint directly.

It seems a common issue for RLC clients and you could reproduce it in https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest.

@jeremymeng jeremymeng self-assigned this Dec 30, 2024
@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. eslint plugin labels Dec 30, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 30, 2024
@jeremymeng
Copy link
Member

Yeah this is likely due to our recent refactoring/improvement around tsconfig files. I am going to try the suggested parserOptions.projectService change

jeremymeng added a commit that referenced this issue Dec 30, 2024
This address the issue when running `lint:fix` using the first
suggestion provided by typescript-eslint

> 0:0 error Parsing error: ESLint was configured to run on
`<tsconfigRootDir>/test/public/utils/recordedClient.ts` using
`parserOptions.project`: <tsconfigRootDir>/tsconfig.json
That TSConfig uses project "references" and doesn't include
`<tsconfigRootDir>/test/public/utils/recordedClient.ts` directly, which
is not supported by `parserOptions.project`.
Either:
>- Switch to `parserOptions.projectService`
>- Use an ESLint-specific TSConfig
See the typescript-eslint docs for more info:
https://typescript-eslint.io/troubleshooting/typed-linting#are-typescript-project-references-supported

-------

### Packages impacted by this PR
eslint-plugin

### Issues associated with this PR
#32350
@jeremymeng
Copy link
Member

@kazrael2119 Is it working now?

@kazrael2119
Copy link
Contributor Author

@kazrael2119 Is it working now?

@jeremymeng lint:fix works now, thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. eslint plugin
Projects
None yet
Development

No branches or pull requests

3 participants