@pragmatiks/lint 0.12.0 → 0.13.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## js-v0.13.0 (2026-11-29)
4
+
5
+ ### Features
6
+
7
+ - **rules**: add pra-no-underscore-members for principle 13
8
+
3
9
  ## js-v0.12.0 (2026-11-20)
4
10
 
5
11
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pragmatiks/lint",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Pragmatiks engineering principles eslint config and bundled semgrep rules.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,33 @@
1
+ rules:
2
+ - id: pra-no-underscore-members
3
+ pattern-either:
4
+ - patterns:
5
+ - patterns:
6
+ - pattern-either:
7
+ - pattern: $NAME = $VALUE
8
+ - pattern: "..., $NAME, ... = $VALUE"
9
+ - pattern: "[..., $NAME, ...] = $VALUE"
10
+ - pattern: "$NAME: $TYPE = $VALUE"
11
+ - pattern: "$NAME: $TYPE"
12
+ - pattern: $OBJECT.$NAME = $VALUE
13
+ - pattern: "..., $OBJECT.$NAME, ... = $VALUE"
14
+ - pattern: "$OBJECT.$NAME: $TYPE = $VALUE"
15
+ - metavariable-regex:
16
+ metavariable: $NAME
17
+ regex: '^(?!.*[^_]_$)_(?P<STEM>[a-z]\w*)$'
18
+ - pattern-not-inside: |
19
+ class $CLASS:
20
+ ...
21
+ def $STEM(...): ...
22
+ - patterns:
23
+ - pattern-either:
24
+ - pattern: "def $NAME(...): ..."
25
+ - pattern: "async def $NAME(...): ..."
26
+ - metavariable-regex:
27
+ metavariable: $NAME
28
+ regex: '^(?!.*[^_]_$)_[a-z]\w*$'
29
+ message: "principle #13 leading underscore with no same-named public property or accessor in the class. Use the plain public name; keep the underscore only on a backing field behind a same-named property."
30
+ severity: WARNING
31
+ languages: [python]
32
+ metadata:
33
+ note: "A field target is allowlisted when its class defines a method named like it without the underscore (a property, setter or accessor). Parameters, dunders, sunders such as Enum's _missing_, self, cls and the throwaway _ are never flagged; a field backing a property inherited from a base class is flagged and needs reviewer judgment."