Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require-description-complete-sentence not working correctly with single period in description #573

Closed
krutoo opened this issue Jun 9, 2020 · 1 comment · Fixed by #967

Comments

@krutoo
Copy link

krutoo commented Jun 9, 2020

Expected behavior

require-description-complete-sentence with @return should cause an error/warning

/**
 * Just a component.
 * @param {Object} props Свойства.
 * @return {ReactElement}. // problem are here (just a dot does not causes errors)
 */

Actual behavior

There is no warnings/errors

ESLint Config

Large ESLint config here
module.exports = {
  plugins: [
    'jest',
    'import',
    'jsdoc',
  ],
  env: {
    browser: true,
    es6: true,
    node: true,
    'jest/globals': true,
  },
  settings: {
    react: {
      version: 'detect',
    },
    jsdoc: {
      tagNamePreference: {
        arg: 'param',
        argument: 'param',
        class: 'constructor',
        returns: 'return',
        virtual: 'abstract',
      },
      preferredTypes: {
        any: '*',
        array: 'Array',
        Boolean: 'boolean',
        float: 'number',
        function: 'Function',
        int: 'number',
        integer: 'number',
        Null: 'null',
        Number: 'number',
        object: 'Object',
        String: 'string',
        Symbol: 'symbol',
        Undefined: 'undefined',
      },
    },
  },
  extends: [
    'eslint:recommended',
    'plugin:jsdoc/recommended',
  ],
  parser: 'babel-eslint',
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
    },
  },
  rules: {
    'array-bracket-newline': [
      'error',
      'consistent',
    ],
    'array-bracket-spacing': [
      'error',
      'never',
    ],
    'array-callback-return': 'error',
    'arrow-body-style': [
      'error',
      'as-needed',
    ],
    'arrow-parens': [
      'error',
      'as-needed',
    ],
    'arrow-spacing': [
      'error',
      {
        before: true,
        after: true,
      },
    ],
    camelcase: [
      'error',
      {
        properties: 'never',
        ignoreDestructuring: false,
      },
    ],
    'comma-dangle': [
      'error',
      {
        arrays: 'always-multiline',
        exports: 'always-multiline',
        imports: 'always-multiline',
        objects: 'always-multiline',
      },
    ],
    'comma-spacing': [
      'error',
      {
        before: false,
        after: true,
      },
    ],
    curly: [
      'error',
      'all',
    ],
    'dot-notation': 'error',
    'eol-last': [
      'error',
      'always',
    ],
    eqeqeq: 'error',
    'function-paren-newline': [
      'error',
      'consistent',
    ],
    'generator-star-spacing': [
      'error',
      {
        before: true,
        after: true,
      },
    ],
    'import/newline-after-import': [
      'error',
      {
        count: 1,
      },
    ],
    'import/no-anonymous-default-export': [
      'error',
      {
        allowAnonymousClass: false,
        allowAnonymousFunction: false,
        allowArray: false,
        allowArrowFunction: false,
        allowCallExpression: true,
        allowLiteral: false,
        allowObject: false,
      },
    ],
    indent: [
      'error',
      2,
      {
        SwitchCase: 1,
        MemberExpression: 1,
        ObjectExpression: 1,
        ignoredNodes: [
          'TemplateLiteral *',
        ],
      },
    ],
    'jest/no-disabled-tests': 'error',
    'jest/no-focused-tests': 'error',
    'jest/no-identical-title': 'error',
    'jest/prefer-to-have-length': 'error',
    'jest/valid-expect': 'error',
    'jsdoc/check-indentation': 'error',
    'jsdoc/check-param-names': 'error',
    'jsdoc/check-tag-names': 'error',
    'jsdoc/newline-after-description': [
      'error',
      'never',
    ],
    'jsdoc/no-undefined-types': [
      'error',
      {
        definedTypes: [
          'ReactElement',
          'SyntheticEvent',
        ],
      },
    ],
    'jsdoc/require-description-complete-sentence': [
      'error',
      {
        tags: [
          'typedef',
          'property',
        ],
      },
    ],
    'jsdoc/require-param': 'error',
    'jsdoc/require-param-description': 'error',
    'jsdoc/require-param-name': 'error',
    'jsdoc/require-param-type': 'error',
    'jsdoc/require-returns': 'error',
    'jsdoc/require-returns-check': 'error',
    'jsdoc/require-returns-description': 'error',
    'jsdoc/require-returns-type': 'error',
    'jsdoc/valid-types': 'error',
    'jsx-quotes': [
      'error',
      'prefer-single',
    ],
    'key-spacing': [
      'error',
      {
        mode: 'strict',
        beforeColon: false,
        afterColon: true,
      },
    ],
    'keyword-spacing': [
      'error',
      {
        before: true,
        after: true,
      },
    ],
    'lines-around-comment': [
      'error',
      {
        allowArrayEnd: true,
        allowArrayStart: true,
        allowBlockEnd: true,
        allowBlockStart: true,
        allowClassEnd: true,
        allowClassStart: true,
        allowObjectEnd: true,
        allowObjectStart: true,
        beforeBlockComment: true,
        beforeLineComment: true,
      },
    ],
    'max-len': [
      'error',
      {
        code: 120,
      },
    ],
    'no-array-constructor': 'error',
    'no-console': 'error',
    'no-duplicate-imports': 'error',
    'no-eval': 'error',
    'no-extra-boolean-cast': 'error',
    'no-extra-parens': [
      'error',
      'all',
      {
        ignoreJSX: 'all',
        nestedBinaryExpressions: false,
      },
    ],
    'no-implicit-coercion': 'error',
    'no-mixed-operators': 'error',
    'no-multi-assign': 'error',
    'no-multi-spaces': 'error',
    'no-multiple-empty-lines': [
      'error',
      {
        max: 1,
        maxBOF: 1,
        maxEOF: 0,
      },
    ],
    'no-nested-ternary': 'error',
    'no-new-func': 'error',
    'no-new-object': 'error',
    'no-new-wrappers': 'error',
    'no-param-reassign': [
      'error',
      {
        props: false,
      },
    ],
    'no-restricted-globals': [
      'error',
      'name',
      'status',
      'find',
      'event',
      'length',
    ],
    'no-shadow': [
      'error',
      {
        builtinGlobals: false,
      },
    ],
    'no-trailing-spaces': 'error',
    'no-undef': 'error',
    'no-unneeded-ternary': 'error',
    'no-use-before-define': [
      'error',
      {
        variables: false,
        functions: false,
        classes: false,
      },
    ],
    'no-useless-constructor': 'error',
    'no-useless-return': 'error',
    'no-var': 'error',
    'no-whitespace-before-property': 'error',
    'object-curly-spacing': [
      'error',
      'always',
      {
        arraysInObjects: true,
      },
    ],
    'object-shorthand': [
      'error',
      'always',
    ],
    'one-var': [
      'error',
      {
        var: 'never',
        let: 'never',
        const: 'never',
      },
    ],
    'operator-linebreak': [
      'error',
      'before',
    ],
    'padded-blocks': [
      'error',
      'never',
    ],
    'prefer-const': 'error',
    'prefer-template': 'error',
    'quote-props': [
      'error', 'as-needed',
    ],
    quotes: [
      'error',
      'single',
    ],
    radix: [
      'error',
      'as-needed',
    ],
    'require-jsdoc': [
      'error',
      {
        require: {
          ArrowFunctionExpression: true,
          ClassDeclaration: true,
          FunctionDeclaration: true,
          FunctionExpression: true,
          MethodDefinition: true,
        },
      },
    ],
    semi: [
      'error',
      'always',
    ],
    'space-before-blocks': 'error',
    'space-before-function-paren': [
      'error',
      'always',
    ],
    'space-in-parens': [
      'error',
      'never',
    ],
    'space-infix-ops': 'error',
    'spaced-comment': [
      'error',
      'always',
    ],
    'template-curly-spacing': [
      'error',
      'never',
    ],
    'template-tag-spacing': [
      'error',
      'never',
    ],
    'yield-star-spacing': [
      'error',
      {
        before: true,
        after: false,
      },
    ],
  },
};

ESLint sample

/**
 * Just a component.
 * @param {Object} props Свойства.
 * @return {ReactElement}. // problem are here (just a dot does not causes errors)
 */
const Component = props => {/* ... */}

Environment

  • Node version: 10.15.3
  • ESLint version 6.8.0
  • eslint-plugin-jsdoc version: 23.1.0

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@brettz9 brettz9 changed the title require-description-complete-sentence not working correctly with return tag require-description-complete-sentence not working correctly with single period in description Jan 3, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
…fixes gajus#573

This reverts commit d77bd1c with the intent to re-release.
brettz9 added a commit that referenced this issue Jan 29, 2023
brettz9 added a commit that referenced this issue Jan 29, 2023
…fixes #573

This reverts commit d77bd1c with the intent to re-release.
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit that referenced this issue Jan 29, 2023
brettz9 added a commit that referenced this issue Jan 29, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 39.7.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants