pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

JSON comments not allow on settings #57

Closed fynncfchen closed 8 years ago

fynncfchen commented 8 years ago

My .pug-lintrc settings

// https://github.com/pugjs/pug-lint/blob/master/docs/rules.md
{
  // "preset": "clock",
  "disallowAttributeConcatenation": true,
  "disallowAttributeInterpolation": true,
  "disallowBlockExpansion": true,
}

but the CLI will shows the message: SyntaxError: Unexpected token / When I removed all the comments, the message never shows up.

benedfit commented 8 years ago

Hi @ethancfchen, unfortunately, this is expected. JSON doesn't allow comments, therefore you'll need to do something similar to this, if you'd like to keep references to all the rules and the original preset:

{
 "_allRules": "https://github.com/pugjs/pug-lint/blob/master/docs/rules.md",
 "_preset": "clock",
  "disallowAttributeConcatenation": true,
  "disallowAttributeInterpolation": true,
  "disallowBlockExpansion": true,
}

Cheers

fynncfchen commented 8 years ago

I know, but this is my .eslintrc setting and it works on es-lint:

// http://eslint.org/docs/rules
{
  "env": {
      "browser": true,
      "node": true
  },
  "rules": {
    // Possible Errors
    "comma-dangle": [2, "never"],
    "no-cond-assign": 2,
  }
}

doesn't matter, I will use standard JSON.