hound icon indicating copy to clipboard operation
hound copied to clipboard

.eslintrc.js format is invalid

Open calpa opened this issue 5 years ago • 7 comments

I have tried to use houndCI, but it finds that 'import' is only available in ES6 (use 'esversion: 6').

Then I add the following as .hound.yml.

eslint:
  enabled: true
  config_file: .eslintrc.js

And it turns out .eslintrc.js format is invalid.

Help wanted.

See more in https://github.com/calpa/gatsby-starter-calpa-blog/pull/100

calpa avatar Nov 04 '18 05:11 calpa

I'm having the same problem... 😨

mtylty avatar Nov 05 '18 18:11 mtylty

I ended up converting the configuration file to json and everything worked fine.

mtylty avatar Nov 06 '18 10:11 mtylty

We currently only support JSON or YAML formats for .eslitrc, due to the fact that we need to parse and merge configs.

gylaz avatar Nov 06 '18 16:11 gylaz

I added more info to our ESLint docs. https://intercom.help/hound/configuration/eslint

@calpa does changing the format of .eslintrc work for you?

salbertson avatar Nov 06 '18 17:11 salbertson

Changing from .eslintrc.js to .eslintrc losses the flexibility of js.

For import/resolver rule, I have to use the following config:

"import/resolver": {
      webpack: {
        config: path.join(__dirname, "webpack.config.js")
      }
    }

Therefore, this project requires to use .eslintrc.js instead of .eslintrc.

calpa avatar Nov 07 '18 00:11 calpa

Well, we could probably support JS format, but we would then have a caveat where org-wide config would not be compatible with JS format.

gylaz avatar Nov 07 '18 03:11 gylaz

@salbertson I still get the hound violations 'import' is only available in ES6 (use 'esversion: 6'). after changing .eslintrc.js to .eslintrc. And I read this information too https://intercom.help/hound/configuration/eslint

Update - .hound.yml wasnt in my root folder was the cause of the error. While checking around I found what was causing the problem, after reading this in the docs Hound will look for a custom configuration file named .hound.yml in the root directory of your project, which lets Hound know what linters to enable or disable. Thanks

Tyak99 avatar Feb 19 '19 19:02 Tyak99