codeclimate / codeclimate-eslint

Code Climate Engine for ESLint
MIT License
95 stars 93 forks source link

Error in codeclimate: Configuration for rule "@typescript-eslint/interface-name-prefix" is invalid #477

Closed Loremaster closed 4 years ago

Loremaster commented 4 years ago

Bug Template

Hey, I am having the issues with @typescript-eslint on codeclimate. Locally eslint works fine but it raises an error when running on codeclimate: Configuration for rule "@typescript-eslint/interface-name-prefix" is invalid although I use the valid setup.

Actual Behavior

No rules are configured. Make sure you have added a config file with rules enabled.
See our documentation at https://docs.codeclimate.com/docs/eslint for more information.
No rules are configured. Make sure you have added a config file with rules enabled.
See our documentation at https://docs.codeclimate.com/docs/eslint for more information.
No rules are configured. Make sure you have added a config file with rules enabled.
See our documentation at https://docs.codeclimate.com/docs/eslint for more information.
No rules are configured. Make sure you have added a config file with rules enabled.
See our documentation at https://docs.codeclimate.com/docs/eslint for more information.
No rules are configured. Make sure you have added a config file with rules enabled.
See our documentation at https://docs.codeclimate.com/docs/eslint for more information.
/usr/local/node_modules/eslint/lib/shared/config-validator.js:138
            throw new Error(`${source}:\n\t${enhancedMessage}`);
            ^

Error: --config:
    Configuration for rule "@typescript-eslint/interface-name-prefix" is invalid:
    Value {"prefixWithI":"always"} should be equal to one of the allowed values.

    at validateRuleOptions (/usr/local/node_modules/eslint/lib/shared/config-validator.js:138:19)
    at Object.keys.forEach.id (/usr/local/node_modules/eslint/lib/shared/config-validator.js:193:9)
    at Array.forEach (<anonymous>)
    at validateRules (/usr/local/node_modules/eslint/lib/shared/config-validator.js:190:30)
    at validateConfigArray (/usr/local/node_modules/eslint/lib/shared/config-validator.js:337:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (/usr/local/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:392:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/usr/local/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:248:21)
    at FileEnumerator._iterateFilesWithFile (/usr/local/node_modules/eslint/lib/cli-engine/file-enumerator.js:321:43)
    at FileEnumerator._iterateFiles (/usr/local/node_modules/eslint/lib/cli-engine/file-enumerator.js:302:25)
    at FileEnumerator.iterateFiles (/usr/local/node_modules/eslint/lib/cli-engine/file-enumerator.js:254:59)

Expected Behavior

I expect build to pass

Steps to reproduce

.codeclimate.yml

version: 2
checks:
  method-complexity:
    config:
      threshold: 6
plugins:
  duplication:
    enabled: true
    exclude_patterns:
      - "**/*.spec.js"
      - "**/__tests__/"
      - "spec/**/*.rb"
      - "**/__mocks__/"
  brakeman:
    enabled: true
  csslint:
    enabled: true
  eslint:
    enabled: true
    channel: "eslint-6"
    config:
      config: .eslintrc
    exclude_patterns:
      - "app/assets/"
  coffeelint:
    enabled: true
    config: coffeelint.json
  scss-lint:
    enabled: true
    checks:
      ImportantRule:
        enabled: false
      ColorVariable:
        enabled: false
      PropertySortOrder:
        enabled: false
  rubocop:
    enabled: true
    channel: rubocop-0-74
    config:
      file: .rubocop.yml

exclude_patterns:
 - "app/assets/config"
 - "config/**/*"
 - "vendor/**/*"
 - "**.min.css"
 - "**.min.js"
 - "node_modules/"
 - "public/"

.eslintrc

{
  "extends": [
    "prettier",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier/@typescript-eslint",
    "plugin:prettier/recommended",
    "plugin:vue/recommended",
    "plugin:jest/recommended"
  ],

  "plugins": ["prettier", "jest", "@typescript-eslint"],

  "parser": "vue-eslint-parser",
  "parserOptions": {
    "parser": "@typescript-eslint/parser"
  },

  "env": {
    "browser": true,
    "jest/globals": true,
    "jquery": true
  },

  "rules": {
    "prettier/prettier": "error",
    "no-param-reassign": [
      "error",
      {
        "props": true,
        "ignorePropertyModificationsFor": ["state", "media", "config"]
      }
    ],
    "vue/max-attributes-per-line": ["error", {
      "singleline": 10,
      "multiline": {
        "max": 1,
        "allowFirstLine": false
      }
    }],
    "vue/singleline-html-element-content-newline": "off", // allow inline text
    "vue/html-self-closing": "off", // to match prettier
    "vue/html-closing-bracket-spacing": "off", // to match prettier
    "vue/attributes-order": "error",
    "vue/attribute-hyphenation": "error",
    "vue/this-in-template": "error",
    "vue/no-v-html": "error",
    "vue/order-in-components": "error",
    "vue/v-on-style": "error",
    "vue/html-indent": "error",
    "vue/html-closing-bracket-newline": "error",
    "vue/multiline-html-element-content-newline": "error",
    "jest/no-mocks-import": "off",
    "@typescript-eslint/interface-name-prefix": ["error", { "prefixWithI": "always" }],
    "@typescript-eslint/no-unused-vars": "error",
    "@typescript-eslint/ban-ts-ignore": "off",
    "@typescript-eslint/explicit-function-return-type": "off", // overriden for only .ts
    "@typescript-eslint/no-explicit-any": "off", // overriden for only .ts
    "@typescript-eslint/no-non-null-assertion": "off" // overriden for only .ts
  },

  "overrides": [{
    // enable the rule specifically for TypeScript files
    "files": ["*.ts"],
    "excludedFiles": "*.spec.ts",
    "rules": {
      "@typescript-eslint/explicit-function-return-type": ["error"]
    }
  },
  {
    // enable the rule specifically for TypeScript files
    "files": ["*.ts"],
    "excludedFiles": "*.spec.ts",
    "rules": {
      "@typescript-eslint/no-explicit-any": ["error"]
    }
  },
  {
    // enable the rule specifically for TypeScript files
    "files": ["*.ts"],
    "excludedFiles": "*.spec.ts",
    "rules": {
      "@typescript-eslint/no-non-null-assertion": ["error"]
    }
  }],

  "settings": {
    "import/resolver": {
      "webpack": {
        "config": {
          "resolve": {
            "modules": ["app/javascript", "node_modules", "spec/javascript"],
            "extensions": [".js", ".vue", ".ts"]
          }
        }
      }
    }
  }
}

package.json

{
  "engines": {
    "node": "12.11.1",
    "npm": "6.9.0",
    "yarn": "1.19.1"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.25",
    "@fortawesome/free-regular-svg-icons": "^5.11.2",
    "@fortawesome/free-solid-svg-icons": "^5.11.2",
    "@fortawesome/vue-fontawesome": "^0.1.8",
    "@rails/webpacker": "^4.2.0",
    "@types/ckeditor": "^4.9.5",
    "@types/jquery": "^3.3.31",
    "@types/lodash": "^4.14.145",
    "@types/node": "^12.12.6",
    "@types/pusher-js": "^4.2.2",
    "@types/qs": "^6.5.3",
    "@types/rosie": "^0.0.36",
    "@types/uuid": "^3.4.6",
    "aws-sdk": "^2.566.0",
    "axios": "^0.19.0",
    "babel-loader": "^8.0.6",
    "babel-polyfill": "^6.26.0",
    "babel-preset-vue": "^2.0.2",
    "bootstrap": "^4.4.1",
    "bootstrap-vue": "^2.2.0",
    "coffeelint": "^2.1.0",
    "date-fns": "^2.7.0",
    "es6-promise": "^4.2.8",
    "immutable": "^4.0.0-rc.12",
    "jquery": "^3.4.1",
    "lodash": "^4.17.15",
    "mutationobserver-shim": "^0.3.3",
    "nodelist-foreach-polyfill": "^1.2.0",
    "pusher-js": "^5.0.2",
    "qs": "^6.9.0",
    "rosie": "^2.0.1",
    "ts-loader": "^6.2.1",
    "typescript": "^3.7.2",
    "uuid": "^3.3.3",
    "vee-validate": "^2.2.15",
    "vue": "^2.6.10",
    "vue-class-component": "^7.1.0",
    "vue-clipboard2": "^0.3.1",
    "vue-ctk-date-time-picker": "^2.4.0",
    "vue-jcrop": "^1.0.3",
    "vue-loader": "^15.7.2",
    "vue-notification": "^1.3.20",
    "vue-property-decorator": "^8.3.0",
    "vue-template-compiler": "^2.6.10",
    "vuex": "^3.1.1",
    "vuex-class": "^0.3.1"
  },
  "devDependencies": {
    "@babel/plugin-transform-modules-commonjs": "^7.7.0",
    "@types/jest": "^24.0.22",
    "@typescript-eslint/eslint-plugin": "^2.18.0",
    "@typescript-eslint/parser": "^2.18.0",
    "@vue/test-utils": "^1.0.0-beta.31",
    "babel-eslint": "^10.0.3",
    "babel-jest": "^24.9.0",
    "eslint": "^6.6.0",
    "eslint-config-prettier": "^6.7.0",
    "eslint-import-resolver-webpack": "^0.11.1",
    "eslint-loader": "^3.0.3",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-jest": "^23.0.4",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-vue": "^6.0.1",
    "flush-promises": "^1.0.2",
    "identity-obj-proxy": "^3.0.0",
    "ignore-loader": "^0.1.2",
    "jest": "^24.9.0",
    "jest-date-mock": "^1.0.7",
    "jest-serializer-vue": "^2.0.2",
    "lint-staged": "^9.4.2",
    "moxios": "^0.4.0",
    "pre-commit": "^1.2.2",
    "prettier": "^1.18.2",
    "stylelint": "^11.1.1",
    "stylelint-config-standard": "^19.0.0",
    "stylelint-scss": "^3.12.1",
    "ts-jest": "^24.1.0",
    "vue-jest": "^4.0.0-beta.2",
    "webpack-dev-server": "^3.9.0"
  },
  "scripts": {
    "test": "jest",
    "lint-staged": "$(yarn bin)/lint-staged"
  },
  "lint-staged": {
    "app/javascript/**/*.js": [
      "prettier --write",
      "eslint",
      "git add"
    ],
    "app/javascript/**/*.ts": [
      "prettier --write",
      "eslint",
      "git add"
    ],
    "app/javascript/**/*.vue": [
      "prettier --write",
      "stylelint --fix",
      "eslint",
      "git add"
    ],
    "app/javascript/**/*.spec.ts": [
      "prettier --write",
      "eslint",
      "git add"
    ],
    "app/assets/stylesheets/**/*": [
      "prettier --write",
      "stylelint --fix",
      "git add"
    ],
    "app/stylesheets/**/*.scss": [
      "prettier --write",
      "stylelint --fix",
      "git add"
    ],
    "app/javascript/**/*.scss": [
      "prettier --write",
      "stylelint --fix",
      "git add"
    ],
    "app/javascript/**/*.json": [
      "prettier --write",
      "git add"
    ]
  },
  "pre-commit": [
    "lint-staged"
  ]
}