ota-meshi / eslint-plugin-jsonc

ESLint plugin for JSON(C|5)? files
https://ota-meshi.github.io/eslint-plugin-jsonc/
MIT License
181 stars 17 forks source link

How config correctly my eslint config with jsonc #305

Closed Pab450 closed 4 months ago

Pab450 commented 4 months ago

My eslint config :

module.exports = {
  rules: {
    "object-curly-newline": [
      "error",
      {
        ExportDeclaration: "always",
        ObjectExpression: "always",
        ImportDeclaration: "never",
        ObjectPattern: "always"
      }
    ],
    "@stylistic/array-bracket-newline": [
      "error",
      "always"
    ],
    "@stylistic/array-element-newline": [
      "error",
      "always"
    ],
    "@typescript-eslint/comma-dangle": [
      "error",
      "never"
    ],
    "@typescript-eslint/quotes": [
      "error",
      "double"
    ],
    "@typescript-eslint/semi": [
      "error",
      "never"
    ],
    "@stylistic/object-property-newline": "error"
  },
  extends: [
    "next/core-web-vitals",
    "airbnb",
    "airbnb/hooks",
    "airbnb-typescript",
    "plugin:perfectionist/recommended-line-length",
    "plugin:tailwindcss/recommended",
    "plugin:jsonc/recommended-with-json"
  ],
  overrides: [
    {
      files: [
        "*.json"
      ],
      parser: "jsonc-eslint-parser"
    }
  ],
  parserOptions: {
    project: "tsconfig.json"
  },
  globals: {
    React: "writable"
  },
  plugins: [
    "@stylistic"
  ]
}

Error i get :

npx eslint . --fix

Oops! Something went wrong! :(

ESLint: 8.56.0

Error: Error while loading rule '@typescript-eslint/naming-convention': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser
JounQin commented 4 months ago

Please use overrides correctly, not only change the parser.