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

v19.8.3 - Expected an assignment or function call and instead saw an expression #28245

Closed
1 of 4 tasks
gperdomor opened this issue Oct 2, 2024 · 4 comments · Fixed by #29457
Closed
1 of 4 tasks

v19.8.3 - Expected an assignment or function call and instead saw an expression #28245

gperdomor opened this issue Oct 2, 2024 · 4 comments · Fixed by #29457
Assignees
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug

Comments

@gperdomor
Copy link
Contributor

gperdomor commented Oct 2, 2024

Current Behavior

I encountered the following ESLint error when running the nx run-many -t lint command for a newly created workspace with plugin

Expected an assignment or function call and instead saw an expression. eslint@typescript-eslint/no-unused-expressions

Expected Behavior

The linting step should not fail with the @typescript-eslint/no-unused-expressions error

GitHub Repo

No response

Steps to Reproduce

  1. Create a new empty workspace
  2. Install @nx/plugin
  3. Create a new plugin with e2e
  4. Run lint

Nx Report

❯ nx report              

 NX   Report complete - copy this into the issue template

Node           : 22.9.0
OS             : darwin-x64
Native Target  : x86_64-macos
npm            : 10.8.3

nx (global)        : 19.8.3
nx                 : 19.8.3
@nx/js             : 19.8.3
@nx/jest           : 19.8.3
@nx/linter         : 19.8.3
@nx/eslint         : 19.8.3
@nx/workspace      : 19.8.3
@nx/devkit         : 19.8.3
@nx/eslint-plugin  : 19.8.3
@nx/plugin         : 19.8.3
@nrwl/tao          : 19.8.3
typescript         : 5.5.4

Failure Logs

❯ nx run-many -t lint

   ✔  nx run my-plugin:lint  [existing outputs match the cache, left as is]

——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
   ✖  nx run my-plugin-e2e:lint
      Linting "my-plugin-e2e"...
      
      /Users/gperdomor/Downloads/nx-tools-v7/plugins/my-plugin-e2e/project.json
        1:1  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
      
      /Users/gperdomor/Downloads/nx-tools-v7/plugins/my-plugin-e2e/tsconfig.json
        1:1  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
      
      /Users/gperdomor/Downloads/nx-tools-v7/plugins/my-plugin-e2e/tsconfig.spec.json
        1:1  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
      
      ✖ 3 problems (3 errors, 0 warnings)
      
      ✖ 3 problems (3 errors, 0 warnings)
      
      

——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Ran target lint for 2 projects (2s)

   ✔  1/2 succeeded [1 read from cache]

   ✖  1/2 targets failed, including the following:

      - nx run my-plugin-e2e:lint

View structured, searchable error logs at https://nx.app/runs/zUZJzouWU1

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Related to #28069

@gperdomor
Copy link
Contributor Author

@jaysoo Hi buddy... I saw that you fix the issue #28069, this it's basically the same but for nx plugins with e2e cases...

@jaysoo jaysoo added the scope: linter Issues related to Eslint support in Nx label Oct 14, 2024
@jaysoo jaysoo self-assigned this Oct 14, 2024
@santoshyadavdev
Copy link
Contributor

@jaysoo I see this issue with react workspace too

eslint .

/Users/s.yadav/react-india/libs/my-awesome-lib/package.json
1:1 error Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions

I am on version Nx 19.8.4

@Bullfrog1234
Copy link
Contributor

I have put in a Change Request that fixes this issues just waiting on review to be completed

FrozenPandaz pushed a commit that referenced this issue Feb 6, 2025
…TS rules to JSON files (#29457)

This PR fixes an issue with React libs, where TS rules are being applied
to JSON files.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28245

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
(cherry picked from commit cbbe14b)
isaacplmann pushed a commit that referenced this issue Feb 11, 2025
…TS rules to JSON files (#29457)

This PR fixes an issue with React libs, where TS rules are being applied
to JSON files.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28245

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
4 participants