Skip to content

How to lint/fix JSON files with this plugin? #294

@caugner

Description

@caugner

What version of eslint are you using?

7.0.1

What version of prettier are you using?

2.0.5

What version of eslint-plugin-prettier are you using?

3.1.3

Please paste any applicable config files that you're using (e.g. .prettierrc or .eslintrc files)

// package.json
{
  // ...
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/recommended",
      "@vue/prettier/recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "prettier": {
    "htmlWhitespaceSensitivity": "strict"
  },
  // ...
}}}

What source code are you linting?

{
    "json_example": { "with": "wrong_format" }
  }

What did you expect to happen?

ESLint should use prettier to lint the JSON file.

What actually happened?

ESLint lints the JSON file as if it's a JavaScript file and complains about a missing semi-colon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions