MiguelCastillo / Brackets-InteractiveLinter

Interactive linting for Brackets
Other
119 stars 26 forks source link

ESLint YAML .eslintrc file does not work #153

Open StephenGregory opened 9 years ago

StephenGregory commented 9 years ago

Description

ESLint supports .eslintrc being written in YAML. The Interactive Linter displays and error message and cannot use the file.

Steps to reproduce

Configure brackets.json appropriately:

{
"interactive-linter.javascript": [
        "eslint"
    ]
}

Create a .eslintrc file in your project directory with the following content:


---
  env:
    browser: true

  rules:
    camelcase:
      - 2

An alert prompt displays the following:

Error processing linter settings SyntaxError: Unexpected number

Other details
  • OS: Windows 8.1
  • Brackets version: 1.4
  • No errors logged in Debug > "Show Developer Tools" - "Console view".
  • Other extensions:
  • Beautify
  • Brackets Git
  • Code Folding
  • Advanced New File
  • Brackets File Icons
  • CDN Finder
  • Code Outline
  • Extract for Brackets (Preview)
  • Indentator
  • Inline Regex Editor
  • QuickDocsJS
  • QuickDocsRegEx
  • Show Whitespace
  • Son of Hammsidian
  • Themes for Brackets
  • Todo
  • Tomorrow Night
  • White Space Sanitizer
  • YAML Linter
StephenGregory commented 9 years ago

I suspect the issue is on this line, wherein it is assumed that the settings file in in JSON.

How after deferring the parsing of the file to ESLint (see getConfigForFile()) ?

MiguelCastillo commented 9 years ago

@StephenGregory thanks for logging this issue. Currently, interactive linter only supports json formatted settings files. I am not totally against supporting YAML. Would you be willing to put together a PR?

StephenGregory commented 9 years ago

Sure! For reference, how have you gone about getting the single eslint.js in your repo (and others)?

Update: I'm thinking those dependencies can be pulled in with npm instead. The reason being is that the dependencies would be more clearly defined, with the added benefit of being to pull in ESLint's config parser.

PhiLhoSoft commented 8 years ago

Yes, I have hit the issue when I switched from JSHint to ESLint, generating (with eslint --init) a Yaml file. I switched to Json, but I would prefer to use Yaml as it allows comments...

BTW (slightly unrelated, I can create a new issue if needed), how can we cleanly update the ESLint version? Some options seems to be unrecognized or limited (eg. line ending and brace placement).