Skip to content

no-node-access rule incorrectly triggering from RTK Query syntax in 7.5.4 #1041

Open
@MrZipper7

Description

@MrZipper7

Have you read the Troubleshooting section?

Yes

Plugin version

7.5.4

ESLint version

v9.30.1

Node.js version

20.19.3

Bug description

After updating to 7.5.4, all instances of RTK Query's endpoint.select() method (https://redux-toolkit.js.org/rtk-query/api/created-api/endpoints#select) are triggering no-node-access errors.

Ex:

const data = api.endpoints.getAllPosts.select(undefined)(store.getState()).data?.data
                                       ~~~~~~
expect(data).toEqual(expectedData)

Steps to reproduce

  1. Define an RTK Query endpoint (https://redux-toolkit.js.org/rtk-query/api/createApi#createapi-parameters.
  2. Call the select function of the endpoint in a test.
  3. Observe the no-node-access error.

Error output/screenshots

Image

ESLint configuration

  {
    files: ['src/**/__test__/*', 'src/**/*.test.ts', 'src/**/*.test.tsx'],
    extends: [
      testingLibrary.configs['flat/react'], 
      vitest.configs.recommended
    ],
    rules: {
      'testing-library/render-result-naming-convention': 'off',
    }
  },

Rule(s) affected

no-node-access

Anything else?

No response

Do you want to submit a pull request to fix this bug?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions