diff --git a/commonjs.cjs b/commonjs.cjs index bb86c5f..2c56691 100644 --- a/commonjs.cjs +++ b/commonjs.cjs @@ -1,6 +1,6 @@ /** @type {import('eslint').Linter.Config} */ -export default { - extends: ["./index.js"], +module.exports = { + extends: ["./index.cjs"], env: { commonjs: true, diff --git a/index.cjs b/index.cjs index f4e1d8b..78224ec 100644 --- a/index.cjs +++ b/index.cjs @@ -20,9 +20,10 @@ module.exports = { "import/order": [ "error", { - pathGroups: [{ pattern: "node:**", group: "builtin" }], - "newlines-between": "always-and-inside-groups", alphabetize: { order: "asc", caseInsensitive: true }, + groups: [["builtin", "external"], "internal", ["parent", "sibling"], "index", "object", "type"], + "newlines-between": "always", + pathGroups: [{ pattern: "node:**", group: "builtin" }], }, ], }, diff --git a/jsdocs.cjs b/jsdocs.cjs new file mode 100644 index 0000000..4070c56 --- /dev/null +++ b/jsdocs.cjs @@ -0,0 +1,64 @@ +/** @type {import('eslint').Linter.Config} */ +module.exports = { + extends: ["./index.cjs"], + + overrides: [ + { + files: ["**.js", "**.cjs", "**.mjs"], + extends: ["plugin:jsdoc/recommended-typescript-flavor-error"], + plugins: ["jsdoc"], + + rules: { + // "jsdoc/check-access": "error", // Recommended + "jsdoc/check-alignment": "error", // Recommended + // "jsdoc/check-examples": "error", + // "jsdoc/check-indentation": "error", + // "jsdoc/check-line-alignment": "error", + // "jsdoc/check-param-names": "error", // Recommended + // "jsdoc/check-property-names": "error", // Recommended + // "jsdoc/check-syntax": "error", + // "jsdoc/check-tag-names": "error", // Recommended + // "jsdoc/check-types": "error", // Recommended + // "jsdoc/check-values": "error", // Recommended + // "jsdoc/empty-tags": "error", // Recommended + // "jsdoc/implements-on-classes": "error", // Recommended + // "jsdoc/informative-docs": "error", + // "jsdoc/match-description": "error", + // "jsdoc/multiline-blocks": "error", // Recommended + // "jsdoc/no-bad-blocks": "error", + // "jsdoc/no-blank-block-descriptions": "error", + // "jsdoc/no-defaults": "error", + // "jsdoc/no-missing-syntax": "error", + // "jsdoc/no-multi-asterisks": "error", // Recommended + // "jsdoc/no-restricted-syntax": "error", + // "jsdoc/no-types": "error", + // "jsdoc/no-undefined-types": "error", // Recommended + "jsdoc/require-asterisk-prefix": "error", + "jsdoc/require-description": "error", + // "jsdoc/require-description-complete-sentence": "error", + // "jsdoc/require-example": "error", + // "jsdoc/require-file-overview": "error", + // "jsdoc/require-hyphen-before-param-description": "error", + // "jsdoc/require-jsdoc": "error", // Recommended + // "jsdoc/require-param": "error", // Recommended + // "jsdoc/require-param-description": "error", // Recommended + // "jsdoc/require-param-name": "error", // Recommended + // "jsdoc/require-param-type": "error", // Recommended + // "jsdoc/require-property": "error", // Recommended + // "jsdoc/require-property-description": "error", // Recommended + // "jsdoc/require-property-name": "error", // Recommended + // "jsdoc/require-property-type": "error", // Recommended + // "jsdoc/require-returns": "error", // Recommended + // "jsdoc/require-returns-check": "error", // Recommended + // "jsdoc/require-returns-description": "error", // Recommended + // "jsdoc/require-returns-type": "error", // Recommended + "jsdoc/require-throws": "error", + // "jsdoc/require-yields": "error", // Recommended + // "jsdoc/require-yields-check": "error", // Recommended + // "jsdoc/sort-tags": "error", + // "jsdoc/tag-lines": "error", // Recommended + // "jsdoc/valid-types": "error", // Recommended + }, + }, + ], +}; diff --git a/package.json b/package.json index f6c929d..7f79070 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@forcir/eslint-config", - "version": "1.0.3", + "version": "1.1.0", "private": false, "description": "Shared configuration for a consistent experience using JavaScript.", "license": "MIT", @@ -27,6 +27,7 @@ "devDependencies": { "@forcir/prettier-config": "1.0.0", "eslint": "8.46.0", + "eslint-plugin-jsdoc": "46.5.1", "prettier": "3.0.0" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e815c1d..037cfac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ devDependencies: eslint: specifier: 8.46.0 version: 8.46.0 + eslint-plugin-jsdoc: + specifier: 46.5.1 + version: 46.5.1(eslint@8.46.0) prettier: specifier: 3.0.0 version: 3.0.0 @@ -56,6 +59,15 @@ packages: js-tokens: 4.0.0 dev: false + /@es-joy/jsdoccomment@0.40.1: + resolution: {integrity: sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==} + engines: {node: '>=16'} + dependencies: + comment-parser: 1.4.0 + esquery: 1.5.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.46.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -355,6 +367,11 @@ packages: dependencies: color-convert: 2.0.1 + /are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + dev: true + /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -448,7 +465,6 @@ packages: /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} - dev: false /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} @@ -508,6 +524,11 @@ packages: /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + /comment-parser@1.4.0: + resolution: {integrity: sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==} + engines: {node: '>= 12.0.0'} + dev: true + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -740,6 +761,26 @@ packages: - supports-color dev: false + /eslint-plugin-jsdoc@46.5.1(eslint@8.46.0): + resolution: {integrity: sha512-CPbvKprmEuJYoxMj5g8gXfPqUGgcqMM6jpH06Kp4pn5Uy5MrPkFKzoD7UFp2E4RBzfXbJz1+TeuEivwFVMkXBg==} + engines: {node: '>=16'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.40.1 + are-docs-informative: 0.0.2 + comment-parser: 1.4.0 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint: 8.46.0 + esquery: 1.5.0 + is-builtin-module: 3.2.1 + semver: 7.5.4 + spdx-expression-parse: 3.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-unicorn@48.0.1(eslint@8.46.0): resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} engines: {node: '>=16'} @@ -1128,7 +1169,6 @@ packages: engines: {node: '>=6'} dependencies: builtin-modules: 3.3.0 - dev: false /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} @@ -1237,6 +1277,11 @@ packages: dependencies: argparse: 2.0.1 + /jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + dev: true + /jsesc@0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -1301,7 +1346,6 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 - dev: false /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -1608,7 +1652,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: false /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -1642,18 +1685,15 @@ packages: /spdx-exceptions@2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: false /spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 spdx-license-ids: 3.0.13 - dev: false /spdx-license-ids@3.0.13: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} - dev: false /string.prototype.trim@1.2.7: resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} @@ -1866,7 +1906,6 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: false /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}