@yasainet/eslint 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @yasainet/eslint might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Shared ESLint configuration for Next.js projects with feature-based architecture",
5
5
  "type": "module",
6
6
  "exports": {
@@ -23,6 +23,7 @@
23
23
  "dependencies": {
24
24
  "@stylistic/eslint-plugin": "^5.9.0",
25
25
  "eslint-plugin-check-file": "^3.3.1",
26
+ "eslint-plugin-jsdoc": "^62.7.1",
26
27
  "eslint-plugin-react-you-might-not-need-an-effect": "^0.5.6",
27
28
  "eslint-plugin-simple-import-sort": "^12.1.1"
28
29
  },
package/src/index.mjs CHANGED
@@ -8,12 +8,14 @@
8
8
  * - cardinality: Action-domain relationships
9
9
  * - directives: "use server" / "use client" requirements
10
10
  * - imports: Repository import restrictions (prefix → lib mapping)
11
+ * - jsdoc: JSDoc description requirements for exported functions
11
12
  */
12
13
 
13
14
  import { baseConfigs, ignoresConfig, sharedRulesConfig } from "./base.mjs";
14
15
  import { cardinalityConfigs } from "./cardinality.mjs";
15
16
  import { directivesConfigs } from "./directives.mjs";
16
17
  import { importsConfigs } from "./imports.mjs";
18
+ import { jsdocConfigs } from "./jsdoc.mjs";
17
19
  import { layersConfigs } from "./layers.mjs";
18
20
  import { namingConfigs } from "./naming.mjs";
19
21
 
@@ -30,4 +32,5 @@ export const eslintConfig = [
30
32
  ...cardinalityConfigs,
31
33
  ...directivesConfigs,
32
34
  ...importsConfigs,
35
+ ...jsdocConfigs,
33
36
  ];
package/src/jsdoc.mjs ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @fileoverview JSDoc configuration for the abstraction layer.
3
+ *
4
+ * Enforces a single rule: every exported function must have a description.
5
+ * Types are handled by TypeScript (machine layer), not JSDoc.
6
+ */
7
+
8
+ import jsdocPlugin from "eslint-plugin-jsdoc";
9
+
10
+ import { featuresGlob } from "./constants.mjs";
11
+
12
+ /**
13
+ * JSDoc configurations requiring descriptions on exported functions.
14
+ * @type {import("eslint").Linter.Config[]}
15
+ */
16
+ export const jsdocConfigs = [
17
+ {
18
+ name: "jsdoc",
19
+ files: [...featuresGlob("**/*.ts"), "src/components/**/*.tsx"],
20
+ plugins: {
21
+ jsdoc: jsdocPlugin,
22
+ },
23
+ rules: {
24
+ "jsdoc/require-jsdoc": [
25
+ "warn",
26
+ {
27
+ publicOnly: true,
28
+ require: {
29
+ FunctionDeclaration: true,
30
+ ArrowFunctionExpression: true,
31
+ FunctionExpression: true,
32
+ },
33
+ checkGetters: false,
34
+ checkSetters: false,
35
+ checkConstructors: false,
36
+ },
37
+ ],
38
+ "jsdoc/require-description": [
39
+ "warn",
40
+ {
41
+ contexts: ["any"],
42
+ },
43
+ ],
44
+ },
45
+ },
46
+ ];
package/src/plugins.mjs CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  import stylistic from "@stylistic/eslint-plugin";
6
6
  import checkFile from "eslint-plugin-check-file";
7
+ import jsdocPlugin from "eslint-plugin-jsdoc";
7
8
  import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
8
9
  import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
9
10
 
@@ -14,12 +15,14 @@ import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
14
15
  export const plugins = {
15
16
  "@stylistic": stylistic,
16
17
  "check-file": checkFile,
18
+ jsdoc: jsdocPlugin,
17
19
  "react-you-might-not-need-an-effect": reactYouMightNotNeedAnEffect,
18
20
  "simple-import-sort": simpleImportSortPlugin,
19
21
  };
20
22
 
21
23
  export {
22
24
  checkFile,
25
+ jsdocPlugin,
23
26
  reactYouMightNotNeedAnEffect,
24
27
  simpleImportSortPlugin,
25
28
  stylistic,