@yasainet/eslint 0.0.15 → 0.0.16

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
@@ -100,22 +100,22 @@ export default [...eslintConfig];
100
100
 
101
101
  ## Release
102
102
 
103
- 1. Update `version` in `package.json`
104
- 2. Commit and push to `main`
105
- 3. Create and push a tag:
103
+ Version is derived from the Git tag. CI automatically sets `package.json` version before publishing.
104
+
105
+ 1. Commit and push to `main`
106
+ 2. Create and push a tag:
106
107
 
107
108
  ```sh
108
109
  git tag v1.0.0
109
110
  git push --tags
110
111
  ```
111
112
 
112
- 4. GitHub Actions will automatically publish to npm
113
+ 3. GitHub Actions will automatically publish to npm
113
114
 
114
115
  ### With lazygit
115
116
 
116
- 1. Update `version` in `package.json`
117
- 2. Stage and commit in lazygit
118
- 3. Select the commit, press `T` to create a tag (e.g. `v1.0.0`)
119
- 4. Press `P` to push the commit
120
- 5. Switch to the Tags panel (`]`), select the tag, and press `P` to push it
121
- 6. GitHub Actions will automatically publish to npm
117
+ 1. Stage and commit in lazygit
118
+ 2. Select the commit, press `T` to create a tag (e.g. `v1.0.0`)
119
+ 3. Press `P` to push the commit
120
+ 4. Switch to the Tags panel (`]`), select the tag, and press `P` to push it
121
+ 5. GitHub Actions will automatically publish to npm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "ESLint",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,24 @@
1
1
  /** @description Scope layer rules to the given feature root */
2
2
  export function createLayersConfigs(featureRoot) {
3
+ const loggerSelector = "CallExpression[callee.object.name='logger']";
4
+ const loggerMessage =
5
+ "logger is not allowed outside actions. Logging belongs in actions.";
6
+
3
7
  return [
8
+ // Logger/console: all features except actions
9
+ {
10
+ name: "layers/logger",
11
+ files: [`${featureRoot}/**/*.ts`],
12
+ ignores: [`${featureRoot}/**/actions/*.ts`],
13
+ rules: {
14
+ "no-console": "error",
15
+ "no-restricted-syntax": [
16
+ "error",
17
+ { selector: loggerSelector, message: loggerMessage },
18
+ ],
19
+ },
20
+ },
21
+ // Repositories: try-catch + if + logger
4
22
  {
5
23
  name: "layers/repositories",
6
24
  files: [`${featureRoot}/**/repositories/*.ts`],
@@ -17,9 +35,11 @@ export function createLayersConfigs(featureRoot) {
17
35
  message:
18
36
  "if statements are not allowed in repositories. Conditional logic belongs in services.",
19
37
  },
38
+ { selector: loggerSelector, message: loggerMessage },
20
39
  ],
21
40
  },
22
41
  },
42
+ // Services: try-catch + logger
23
43
  {
24
44
  name: "layers/services",
25
45
  files: [`${featureRoot}/**/services/*.ts`],
@@ -31,6 +51,7 @@ export function createLayersConfigs(featureRoot) {
31
51
  message:
32
52
  "try-catch is not allowed in services. Error handling belongs in actions.",
33
53
  },
54
+ { selector: loggerSelector, message: loggerMessage },
34
55
  ],
35
56
  },
36
57
  },