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

_ is not defined error even when pragma declared #218

Open
Quitch opened this issue Sep 14, 2019 · 0 comments
Open

_ is not defined error even when pragma declared #218

Quitch opened this issue Sep 14, 2019 · 0 comments

Comments

@Quitch
Copy link

Quitch commented Sep 14, 2019

eslint v6.4.0
eslint-plugin-lodash v6.0.0

'_' is not defined.

_ is not defined is being produced as an error, seemingly regardless of the settings assigned.

I am using plugin:lodash/v3, which defines pragma as _ in its settings, yet all _ references are still causing eslint to produce an error.

An example of such code:

  newPersonalities = _.mapValues(newPersonalities, function (personality, name) {
    var result = _.assign(_.clone(baseline), personality);
    result['name'] = name;
    return result;
  });

The .eslintrc.json config:

{
  "env": {
    "browser": true,
    "node": true,
    "jquery": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:lodash/v3"
  ],
  "plugins": [
    "lodash"
  ]
}

I would expect _ to not generate an error, despite the lack of any import or require, due to the pragma setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant