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

ESLint configuration with cascading/hierarchy #1210

Closed
arxpoetica opened this issue Sep 21, 2016 · 10 comments
Closed

ESLint configuration with cascading/hierarchy #1210

arxpoetica opened this issue Sep 21, 2016 · 10 comments

Comments

@arxpoetica
Copy link

ESLint mentions that config files can have hierarchy and cascade. http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy This doesn't appear to work at all with Hound. Is there a reason this doesn't work?

@gylaz
Copy link
Member

gylaz commented Sep 21, 2016

Hound only supports one ESLint configuration file. This is due to how Hound works. In theory, we could step through directories and look for a config file in each directory hierarchy, but we don't do this right now.

@arxpoetica
Copy link
Author

Bummer.

Feature request? Can you recommend an alternative approach to get such a thing working?

@gylaz
Copy link
Member

gylaz commented Sep 21, 2016

There isn't an alternative that I can think of.

We are big fans of coding style be consistent across the entire project/repo. Can you describe your situation a bit more? We'll definitely consider this as a feature.

@arxpoetica
Copy link
Author

Node projects. Don't enable, for example, browser on the server environment. But enable it for any client js. Vice versa, don't enable node in the client.

@gylaz
Copy link
Member

gylaz commented Sep 21, 2016

Thanks for that. That sounds like a valid situation we hadn't considered, and will help us in evaluating priority of features to work on.

@bardiharborow
Copy link

bardiharborow commented Oct 27, 2016

@gylaz, this is causing us quite a bit of difficulty over at twbs/bootstrap#21005, where our codebase is ES6, but we have browser unit tests written in ES5, because we don't want to have to transpile them. We've set up cascading ESLint configs and it works perfectly with Travis, but Hound only seems to obey the ES6 config (specified in the _hound.yml).

@blackjid
Copy link
Contributor

blackjid commented Oct 27, 2016

This is an idea of how this could be supported.

Given this structure:

app
└── javascript
    ├── .eslintrc.json
    └── components
        └── user-profile
            ├── user-profile.js
            ├── user-profile.html
            └── user-profile.css

This is how I udnerstand hound works now:

  • copy the file that's being linting to a tmp location
  • copy the linters configuration defined in .hound.yml to the tmp location
  • run the linter in the tmp location with a flattened structure where all the cascading config got lost
.eslintrc.json # .hound.yml linters config file
user-profile.js

This is how it could work:

  • copy the file that's being linting to a tmp location maintaining the path structure of the file relative to the project
  • copy the linters configuration defined in .hound.yml to the tmp location root path
  • copy the all the files that match the name of the linters configuration file that are in folders in the path structure
  • run the linter in the tmp location with the original structure and cascading config files
.eslintrc.json # .hound.yml linters config file
app
└── javascript
    ├── .eslintrc.json # cascades config carried over
    └── components
        └── user-profile
            └── user-profile.js

Maybe you already thought about this and maybe there something that doens't work... I would love to hear thoughts

@bardiharborow
Copy link

This is effectively a duplicate of #889.

@blackjid
Copy link
Contributor

mm, yeah you are right...

I missed the real limitation described in the other issue by @thorncp.

Clearly, the limitation here is in the way the files are fetched... would be way easier to make a feature complete service just cloning the repo. I don't know why that is not an option. Every other CI service do that and no everybody is complaining about security issues because of that.

@arxpoetica
Copy link
Author

Closing as duplicate ticket. See: #889.

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

4 participants