Неподдерживаемое исправление правила jsdoc

Используя файл.jsrc, я получаю следующую ошибку для моих файлов сервера / интерфейса. Это приводит к ошибке в верхней части моих файлов. Как я могу подавить это?

Unsupported rule: fix at js/server.js :
 1 |'use strict';

Unsupported rule: fix at js/example.js :
 1 |(function() {

Вот мой .jscsrc файл

  // http://jscs.info/rules.html
  {
    "requireOperatorBeforeLineBreak": true,
    "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
    "maximumLineLength": {
      "value": 100,
      "allowComments": true,
      "allowRegex": true
    },
    "validateIndentation": 2,
    "validateQuoteMarks": { "mark": "'", "escape": true },

    "disallowMultipleLineStrings": true,
    "disallowMixedSpacesAndTabs": true,
    "disallowTrailingWhitespace": true,
    "disallowSpaceAfterPrefixUnaryOperators": true,
    "disallowKeywordsOnNewLine": ["else"],

    "requireSpaceAfterKeywords": [
      "if",
      "else",
      "for",
      "while",
      "do",
      "switch",
      "return",
      "try",
      "catch"
    ],
    "requireSpaceBeforeBinaryOperators": [
        "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
        "&=", "|=", "^=", "+=",

        "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
        "|", "^", "&&", "||", "===", "==", ">=",
        "<=", "<", ">", "!=", "!=="
    ],
    "requireSpaceAfterBinaryOperators": true,
    "requireSpacesInConditionalExpression": true,
    "requireSpaceBeforeBlockStatements": true,
    "requireSpacesInForStatement": true,
    "requireLineFeedAtFileEnd": true,
    "requireSpacesInFunctionExpression": {
        "beforeOpeningCurlyBrace": true
    },
    "disallowSpacesInAnonymousFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInsideArrayBrackets": "all",
    "disallowSpacesInsideParentheses": true,
    "disallowMultipleLineBreaks": true,
    "disallowNewlineBeforeBlockStatements": true
  }

2 ответа

Добавление ниже проверок в.jscsrc удалит ваши ошибки:

"jsDoc": {
    "checkParamNames": true,
    "requireParamTypes": true
}

"validateJSDoc" удален; Пожалуйста, смотрите URL-адреса ниже

Посетите для получения дополнительной информации http://jscs.info/rule/jsDoc.html

Запрос на https://github.com/roots/sage/pull/1522

Зафиксируйте SHA https://github.com/chrisk2020/sage/commit/bcefb5908fdb457d2126833198cd760378ffe949

У меня было одно и то же сообщение об ошибке на всех моих файлах. В моем файле.jscsrc было правило "fix: true"; не могу вспомнить, где я это получил. Он должен был автоматически исправить такие вещи, как ошибки пробелов. Возможно, это работало в предыдущей версии JSCS, но сейчас это не работает. Я использую grunt, и мне пришлось изменить задачу grunt, чтобы получить желаемый результат. Где раньше у меня было

grunt.config.set('jscs', {
  js: {
    src: [ /* path to my files */ ]
  }
});

Я добавил следующее после src:

options: {
  config: ".jscsrc",
  fix: true
}
Другие вопросы по тегам