gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.1k stars 159 forks source link

Syntax error in type: String eslint jsdoc/valid-types #874

Closed fab1o closed 2 years ago

fab1o commented 2 years ago

Getting error:

Syntax error in type: String eslint jsdoc/valid-types
Syntax error in namepath: value eslint jsdoc/valid-types

Uppercase String is not working

/**
 * @param {String} value
 * @desc Parses strings
 * @returns {String}
 */
function parseString(value) {
    return '';
}
plugins: ['jsdoc'],
    extends: ['plugin:jsdoc/recommended'],
    rules: {
        'jsdoc/no-undefined-types': 'off'
    },
    settings: {
        jsdoc: {
            preferredTypes: {
                string: {
                    message: 'Wrong @{{tagName}}{{tagValue}} type "string"; prefer: String',
                    replacement: 'String'
                }
            },
            tagNamePreference: {
                return: {
                    message: '@returns is to be used over @return',
                    replacement: 'returns'
                },
                description: {
                    message: '@desc is to be used over @description',
                    replacement: 'desc'
                }
            }
        }
    }

What am I missing?

brettz9 commented 2 years ago

I am not able to replicate any problem with that code with valid-types. Are you running it in a particular environment like Vue? Can you provide a minimal reproducible test repo?

brettz9 commented 2 years ago

Closing, though feel free to reply further if you come up with a test repo to reproduce or provide more details on your environment.