最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

eslint - Code Climate - Definition for rule '@stylisticindent' was not found - Stack Overflow

programmeradmin1浏览0评论

I've researched this for quite awhile myself, looked through Code Climate and ES Lint GitHub issues and reached out to ES Lint community support on Discord with no luck.

I've followed the steps to properly configure @stylistic/eslint-plugin using a Legacy Config. My configuration has the same structure as theres. I'm using multiple @stylistic rules and I've verified they aren't deprecated.

For the purpose of this question I'll focus on @stylistic/indent although I have many rules with the same error in Code Climate.

I'm able to run yarn lint locally with no problems. However when I submit a pull request and Code Climate scans the changes I get a lot of NEW issues with the title

"Definition for rule '@stylistic/indent' was not found."

Any help would be greatly appreciated. Below is the majority of our .eslintrc.json file with many of the extra rules removed for clarity.

{
  "env": {
    "jest": true
  },
  "globals": {
    "JSX": true
  },
  "extends": [
    "airbnb",
    "next",
    "next/core-web-vitals",
    "plugin:jest/recommended",
    "plugin:jest/style",
    "plugin:jsx-a11y/recommended",
    "plugin:react/jsx-runtime",
    "plugin:react/recommended",
    "prettier"
  ],
  "parserOptions": {
    "ecmaVersion": 2020,
    "ecmaFeatures": {
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": [
    "jest",
    "react",
    "@stylistic"
  ],
  "settings": {
    "jest": {
      "version": 29
    },
    "import/resolver": {
      "node": {
        "extensions": [
          ".js",
          ".jsx",
          ".ts",
          ".tsx"
        ]
      }
    }
  },
  "rules": {
    "@stylistic/eol-last": ["error", "always"],
    "@stylistic/indent": ["error", 2, { "SwitchCase": 1 }],
    "@stylistic/max-len": ["error", 180],
    "@stylistic/quotes": ["error", "single"],
    "@stylistic/semi": ["error", "always"],
    "@stylistic/space-before-function-paren": ["error", "always"]
  }
}


发布评论

评论列表(0)

  1. 暂无评论