@simplysm/eslint-plugin 12.16.41 → 12.16.42

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/README.md CHANGED
@@ -34,7 +34,7 @@ npm install @simplysm/eslint-plugin
34
34
 
35
35
  ### Default Export
36
36
 
37
- ```typescript
37
+ ```javascript
38
38
  export default {
39
39
  configs: {
40
40
  root: FlatConfig[]
@@ -54,6 +54,7 @@ A complete flat ESLint configuration array that includes:
54
54
  - **JS/JSX rules**: `eqeqeq`, `no-console` (warn), `no-shadow`, `require-await`, unused imports enforcement, import dependency checks, and Simplysm rules (`no-subpath-imports-from-simplysm`, `no-hard-private`)
55
55
  - **TS/TSX rules**: All JS rules plus TypeScript-specific rules (`strict-boolean-expressions`, `no-floating-promises`, `return-await`, `prefer-readonly`, `typedef`, `no-unnecessary-condition`, etc.), Angular ESLint inline template processing, and additional Simplysm rules (`ts-no-throw-not-implement-error`, `ts-no-unused-injects`, `ts-no-unused-protected-readonly`)
56
56
  - **HTML rules**: Angular template parser with `ng-template-no-todo-comments` and `ng-template-sd-require-binding-attrs`
57
+ - **vitest.config rules**: Allows devDependencies in vitest config files
57
58
 
58
59
  ### `ts-no-throw-not-implement-error`
59
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/eslint-plugin",
3
- "version": "12.16.41",
3
+ "version": "12.16.42",
4
4
  "description": "심플리즘 패키지 - ESLINT 플러그인",
5
5
  "author": "김석래",
6
6
  "repository": {
@@ -1,5 +1,4 @@
1
1
  import { readdirSync, existsSync } from "node:fs";
2
- import { fileURLToPath } from "node:url";
3
2
  import path from "node:path";
4
3
  import globals from "globals";
5
4
  import tseslint from "typescript-eslint";
@@ -8,7 +7,7 @@ import ngeslint from "angular-eslint";
8
7
  import importPlugin from "eslint-plugin-import";
9
8
  import unusedImportsPlugin from "eslint-plugin-unused-imports";
10
9
 
11
- const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../..");
10
+ const rootDir = process.cwd();
12
11
  const packagesDir = path.join(rootDir, "packages");
13
12
  const allPackageDirs = [
14
13
  rootDir,
@@ -0,0 +1,37 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import path from "node:path";
3
+
4
+ describe("root config rootDir", () => {
5
+ it("packageDir이 process.cwd() 기반 경로를 포함해야 한다", async () => {
6
+ const configModule = await import("../src/configs/root.js");
7
+ const configs = configModule.default;
8
+
9
+ // packageDir 옵션이 있는 import/no-extraneous-dependencies 룰 찾기
10
+ const configWithPackageDir = configs.find((c: any) => {
11
+ const rule = c.rules?.["import/no-extraneous-dependencies"];
12
+ return Array.isArray(rule) && rule[1]?.packageDir;
13
+ });
14
+ expect(configWithPackageDir).toBeDefined();
15
+
16
+ const [, ruleOptions] = configWithPackageDir.rules["import/no-extraneous-dependencies"];
17
+ expect(ruleOptions.packageDir).toContain(process.cwd());
18
+ });
19
+
20
+ it("packageDir에 packages/ 하위 패키지 경로가 포함되어야 한다", async () => {
21
+ const configModule = await import("../src/configs/root.js");
22
+ const configs = configModule.default;
23
+
24
+ const configWithPackageDir = configs.find((c: any) => {
25
+ const rule = c.rules?.["import/no-extraneous-dependencies"];
26
+ return Array.isArray(rule) && rule[1]?.packageDir;
27
+ });
28
+ const [, ruleOptions] = configWithPackageDir.rules["import/no-extraneous-dependencies"];
29
+
30
+ // process.cwd()/packages/ 하위 디렉토리가 최소 1개 포함
31
+ const packagesDir = path.join(process.cwd(), "packages");
32
+ const subPackageDirs = ruleOptions.packageDir.filter(
33
+ (d: string) => d !== process.cwd() && d.startsWith(packagesDir),
34
+ );
35
+ expect(subPackageDirs.length).toBeGreaterThan(0);
36
+ });
37
+ });