question-mark
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.

Can't disable an env in a single file

See original GitHub issue

I’ve got a project all written in ES6, except for a single file that is in ES5.

In my .eslintrc:

env:
  es6: true
  node: true
  browser: true

In the single ES5 file:

/*eslint-env es6:false*/

const fn = () => {};

I expected to get an eslint error for the fat arrow, but there’s no error.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

6reactions
ejosafatcommented, Jun 10, 2016

So in the end there is no plan to add this feature (disabling an env in a comment)? It’s quite useful when you are gradually migrating your app from ES5 and ES6 and have a mix of both in the same folder, and it’s always better to remove comments disabling es6 as you migrate rather than adding them to enable it.

1reaction
demisxcommented, Sep 12, 2016

Looks like this is now availabe, at least in v3.3.1 I am using:

/* eslint-env es6 */

More here: http://eslint.org/docs/user-guide/configuring

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide .env file from Github - Stack Overflow
1st try: create .gitignore in your root project then include your file which want to ignore in GitHub repository. if 1st one do...
Read more >
Why I can't permanently remove these environment variables ...
No, unset cannot permanently remove environment variables, much like export does not permanently set them either, because there is simply no ...
Read more >
Overriding One Single Value in Your Docker-Compose .env File
In Conclusion​​ Overriding a single value in your docker-compose . env file is reasonably simple: just set an environment variable with the same...
Read more >
Environment variables in Compose | Docker Documentation
There are multiple parts of Compose that deal with environment variables in one sense or another. This page should help you find the...
Read more >
Env Variables and Modes - Vite
An env file for a specific mode (e.g. .env.production ) will take higher priority than a ... To prevent accidentally leaking env variables...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found