Skip to content

eslint-plugin-security: TypeError: Cannot read property 'recommended' of undefined #359

Closed
@davehenton

Description

@davehenton

I'm working with a customer who is running into an error surrounding eslint-plugin-security

When the user has the following configuration in their .eslintrc.json:

"plugins": [
  "security"
],
"extends": [
  "plugin:security/recommended"
]

They run into the following error:

engine eslint failed with status 1 and stderr 
/usr/local/node_modules/eslint/lib/config/config-file.js:434
            throw e;
            ^

TypeError: Cannot read property 'recommended' of undefined
Referenced from: /code/./.eslintrc.json
    at loadConfigFile (/usr/local/node_modules/eslint/lib/config/config-file.js:217:40)
    at load (/usr/local/node_modules/eslint/lib/config/config-file.js:535:18)
    at configExtends.reduceRight.e (/usr/local/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/usr/local/node_modules/eslint/lib/config/config-file.js:408:28)
    at Object.load (/usr/local/node_modules/eslint/lib/config/config-file.js:566:22)
    at loadConfig (/usr/local/node_modules/eslint/lib/config.js:63:33)
    at new Config (/usr/local/node_modules/eslint/lib/config.js:229:42)
    at CLIEngine.getConfigForFile (/usr/local/node_modules/eslint/lib/cli-engine.js:774:30)
    at Object.run (/usr/src/app/lib/eslint.js:236:56)

When the 'plugin:' flag is removed, they receive a different error:

Module not supported: eslint-config-security/recommended
ESLint is running with the /usr/local/node_modules/babel-eslint/index.js parser.

Ignoring the following rules that rely on module resolution:

* import/extensions
* import/no-unresolved
* import/no-extraneous-dependencies
* import/no-named-as-default
* import/no-absolute-path
* import/no-duplicates
* import/no-named-as-default-member

This is an OSS repository, which you can check out here.

I'm not sure exactly what's going on here. Is it possible that it's related to 9771 or 9767?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions