@yasainet/eslint 0.1.2 → 0.1.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Shared ESLint configuration for Next.js projects with feature-based architecture",
5
5
  "type": "module",
6
6
  "exports": {
package/src/constants.mjs CHANGED
@@ -4,9 +4,26 @@
4
4
 
5
5
  import fs from "fs";
6
6
  import path from "path";
7
+ import { fileURLToPath } from "url";
7
8
 
8
- /** Project root directory (resolved from the consuming project's CWD) */
9
- const PROJECT_ROOT = process.cwd();
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
+
11
+ /** Find the project root by walking up from this package's location in node_modules */
12
+ function findProjectRoot() {
13
+ let dir = __dirname;
14
+ while (dir !== path.dirname(dir)) {
15
+ if (
16
+ fs.existsSync(path.join(dir, "package.json")) &&
17
+ !dir.includes("/node_modules/")
18
+ ) {
19
+ return dir;
20
+ }
21
+ dir = path.dirname(dir);
22
+ }
23
+ return process.cwd();
24
+ }
25
+
26
+ const PROJECT_ROOT = findProjectRoot();
10
27
 
11
28
  /**
12
29
  * Root directories containing feature modules.
package/src/jsdoc.mjs CHANGED
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * Enforces a single rule: every exported function must have a description.
5
5
  * Types are handled by TypeScript (machine layer), not JSDoc.
6
+ *
7
+ * Targets: repositories, domains, utils.
8
+ * Excludes: actions, hooks, components, schemas, constants.
6
9
  */
7
10
 
8
11
  import jsdocPlugin from "eslint-plugin-jsdoc";
@@ -16,7 +19,11 @@ import { featuresGlob } from "./constants.mjs";
16
19
  export const jsdocConfigs = [
17
20
  {
18
21
  name: "jsdoc",
19
- files: [...featuresGlob("**/*.ts"), "src/components/**/*.tsx"],
22
+ files: [
23
+ ...featuresGlob("**/repositories/*.ts"),
24
+ ...featuresGlob("**/domain*/*.ts"),
25
+ ...featuresGlob("**/util*/*.ts"),
26
+ ],
20
27
  plugins: {
21
28
  jsdoc: jsdocPlugin,
22
29
  },