nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open gperdomor opened this issue 1 year ago • 2 comments

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

  • [X] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

Related to #28069

gperdomor avatar Oct 02 '24 15:10 gperdomor

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

gperdomor avatar Oct 02 '24 15:10 gperdomor

@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

santoshyadavdev avatar Oct 15 '24 11:10 santoshyadavdev

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

Bullfrog1234 avatar Jan 03 '25 06:01 Bullfrog1234

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[bot] avatar Feb 28 '25 00:02 github-actions[bot]