Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

EsLint of standalone JS not working after v3.1.1 #291

Closed
JohnMurga opened this issue Nov 17, 2015 · 8 comments
Closed

EsLint of standalone JS not working after v3.1.1 #291

JohnMurga opened this issue Nov 17, 2015 · 8 comments
Assignees

Comments

@JohnMurga
Copy link
Contributor

I open JS files in isolation sometimes, when there is no related project or .eslintrc file.

Under these conditions under 3.1.1 it does run EsLint with the default rules, which is nice for catching some issues when scanning code.

This hasn't been working for a while, despite the following in my config.cson.

  "linter-eslint":
    disableWhenNoEslintrcFileInPath: false

Downgrading to 3.1.1 gives the desired behavior, any version after does not work.

I was thinking someone must have reported this, so have been manually downgrading to 3.1.1 on every update for a few weeks 😱

@Arcanemagus
Copy link
Member

eslint after version 1.0.0 have no default rules set, if you want a set of default configuration either place a .eslintrc file in your home directory (or whatever directory is a "parent" to your project folders), or hard code a configuration path in the very latest version.

@JohnMurga
Copy link
Contributor Author

Thanks ...
Is it possible to get .eslintrc from .atom or a directory relative to that instead of $HOME or project ?
I maintain https://github.com/JohnMurga/atom-portable, and have not found a way of bundling a default .eslintrc file, which is why I have to roll back to 3.1.1 every time.

@steelbrain
Copy link
Contributor

@JohnMurga We have a config where you can specify path to the eslintrc config and it'll be used when none is found in project

@JohnMurga
Copy link
Contributor Author

@steelbrain yes, but the path is either absolute or relative to the project directory ...
For a portable setting I would need something relative to $ATOM_HOME

@steelbrain
Copy link
Contributor

One "workaround" I can think of is by setting .eslintrc in ~/.atom/init.coffee.

@JohnMurga
Copy link
Contributor Author

@steelbrain that would be OK I guess ...
Please forgive me. but I am not quite sure ...
Do you mean programatically setting the absolute "linter-eslint".eslintrcPath at startup ?

@steelbrain
Copy link
Contributor

@JohnMurga Yep, that's what I mean, I think atom has services where you can wait until all packages have finished activation, and once they have, you can just set that config

SpainTrain pushed a commit to SpainTrain/linter-eslint that referenced this issue Nov 17, 2015
* Interpolate environment variables in the provided path for the eslint config file

Closes AtomLinter#291
@SpainTrain
Copy link
Member

I think this #297 plus $ATOM_HOME would allow this use case?

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

No branches or pull requests

4 participants