Skip to content

testing-library/no-node-access triggered without testing-library imported #336

Closed
@flip-it

Description

@flip-it

As soon as I access children on an arbitrary object, the error testing-library/no-node-access is triggered, even when testing-library is not used in this file. It's not even in a test file. So essentially adding a new file with content:

const zone = {};
console.log(zone.children);

and then running eslint on it fails with message Avoid direct Node access. Prefer using the methods from Testing Library.

I have seen the utility isTestingLibraryImported but can't find if it's actually used anywhere. Or am I missing something?

My eslint config is something like:

{
    parser: '@babel/eslint-parser',
    plugins: ['ramda', 'jest-dom', 'testing-library'],
    extends: [
        'react-app',
        'airbnb',
        'plugin:ramda/recommended',
        'plugin:jest-dom/recommended',
        'plugin:testing-library/react',
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions