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
Useful JSDoc rules (JSCS and Others) #9827
Comments
Possible defaults for "preferType": {
"array": "Array",
"Boolean": "boolean",
"date": "Date",
"Number": "number",
"object": "Object",
"regex": "RegExp",
"String": "string"
} or "preferType": {
"array": "Array",
"boolean": "Boolean",
"date": "Date",
"number": "Number",
"object": "Object",
"regex": "RegExp",
"string": "String"
} |
@simonepri Thanks for the list. Have you looked at https://github.com/gajus/eslint-plugin-jsdoc ? Our goal with JSCS migration is not to have every single JSCS rule in ESLint, but to have a way of migrating out of JSCS. We specifically decided to drop some of the JSCS rules, because they were not generic enough (for example JSCS had a rule specifically for jQuery usage, ESLint doesn't allow framework specific rules). |
Hi @ilyavolodin! Anyway, looking at the table, for example, are these three rules: There are lots of rules inside ESLint like: It may make sense for you to have a new rule inside ESLint called Thanks! |
I personally have a mixed feelings about adding more JSDoc rules to the core. On one hand - they are useful, and I use them myself. On the other - JSDoc is not part of ECMAScript spec at all, and is a convention that's built on top of JS. More than that, there doesn't even seems to be an agreement on the convention itself. Doctrine that ESLint uses, doesn't follow the same rules as Google's JSDoc parser. From my perspective, I would like to see those rules added, but maybe to eslint-plug-jsdoc instead of the core. |
I perfectly understand your point of view. But question arises naturally. It does not makes too sense for me to have some rules inside ESLint and others inside a plugin. My thought (maybe wrong) when I first saw those rules was: |
Both of the JSDoc rules that we have in the core has been added a long time ago, before ESLint had support for plugins (as far as I remember, at least). There was even a conversation at some point about moving them out into eslint-plugin-jsdoc. Now that we have a policy of not removing existing rules from the core, we wouldn't be able to get rid of them at all (just deprecate them, which feels somewhat useless, when we don't provide a new rule to replace deprecated one). I'm not strongly oppose to adding new JSDoc rules to the core if deemed necessary, but let's see how the rest of the team feels. |
Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn't get consensus from the team, so I'm closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design -- we can't realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they're worth adding. Since ESLint is pluggable and can load custom rules at runtime, the lack of consensus among the ESLint team doesn't need to be a blocker for you using this in your project, if you'd find it useful. It just means that you would need to implement the rule yourself, rather than using a bundled rule that is packaged with ESLint. |
I have read the issue discussing about the gaps between ESLint and JSCS but I haven't found nothing about the JSDoc rules.
I'm not using JSCS but they seems really useful.
ESLint now supports only these 2 rules:
https://eslint.org/docs/rules/require-jsdoc
https://eslint.org/docs/rules/valid-jsdoc
I've created a table to show some gaps between ESLint and JSCS.
The text was updated successfully, but these errors were encountered: