Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment plugin does not work if it is a scoped package

See original GitHub issue

Tell us about your environment

  • ESLint Version: 6.2.2
  • Node Version: 12.8.0
  • npm Version: 6.10.2

What parser (default, Babel-ESLint, etc.) are you using? Default

Please show your full configuration:

Attempt 1
  "env": {
    "truffle/truffle": true
  "plugins": [
Attempt 2
  "env": {
    "@4cadia/eslint-plugin-truffle/truffle": true
  "plugins": [

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

I have created a little plugin to define truffle global variables:

module.exports = {
  environments: {
    truffle: {
      globals: {
        artifacts: 'readonly',
        contract: 'readonly',
        assert: 'readonly',
        web3: true,

Currently, I am using npm link to use it as a local package. The gotcha is that it was supposed to be a scoped package: @4cadia/eslint-plugin-truffle.

Then in the actual repo which depends upon the plugin, I run it as:

eslint test/Indexer.test.js

What did you expect to happen? ESLint should use the plugin and not report any errors in the file as described in the docs.

What actually happened? Please include the actual, raw output from ESLint. I get the following error:

> Error: .eslintrc:
>         Environment key "truffle/truffle" is unknown

The same happens if I use the "@4cadia/eslint-plugin-truffle/truffle" env in the configuration file instead.

IMPORTANT: However, if I drop the @4cadia scope in the package name and publish/link it as eslint-plugin-truffle, the code from Attempt 1 works as expected.

Are you willing to submit a pull request to fix this bug?

I am not familiar with the ESLint code base. If someone could please point me to a place to start, I would be happy to contribute.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

platinumazurecommented, Aug 30, 2019

Hi @hbarcelos, thanks for the issue.

I think we should definitely support scoped packages here. We’ll mark this as accepted if we can recreate the issue.

kaicataldocommented, Sep 30, 2019

Closing this issue as the question has been answered.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eclipse rcp - Can't access package scoped field of depend plugin ...
In a normal java environment I can access package-scoped members if I define my class in the same package. Apparently this is not...
Read more >
package.json - npm Docs
The names of scoped packages can begin with a dot or an underscore. This is not permitted without a scope. New packages must...
Read more >
Best practices for creating a modern npm package - Snyk
Note: If you cloned the example repository, you won't need to do this step. Update the name property in package.json with a scoped...
Read more >
Shareable Configs - ESLint - Pluggable JavaScript Linter
Shareable configs are simply npm packages that export a configuration object. ... always including a default config for your plugin to avoid errors....
Read more >
Configuration options | Yarn - Package Manager
yarnrc won't do). Environment variables can be accessed from setting definitions by using the ${NAME} syntax when defining the values. By default Yarn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found