@paperless/conventions 2.22.0-alpha.41 → 2.22.0-alpha.43

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
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.22.0-alpha.43](https://github.com/Employes/Paperless/compare/v2.22.0-alpha.42...v2.22.0-alpha.43) (2026-02-03)
7
+
8
+ **Note:** Version bump only for package @paperless/conventions
9
+
10
+
11
+
12
+
13
+
14
+ # [2.22.0-alpha.42](https://github.com/Employes/Paperless/compare/v2.22.0-alpha.41...v2.22.0-alpha.42) (2026-02-02)
15
+
16
+
17
+ ### Features
18
+
19
+ * **conventions:** Add early return and if/else rules ([d41b65b](https://github.com/Employes/Paperless/commit/d41b65bb4ec380499788dbab28a83262a0ba3d9c))
20
+
21
+
22
+
23
+
24
+
6
25
  # [2.22.0-alpha.41](https://github.com/Employes/Paperless/compare/v2.22.0-alpha.40...v2.22.0-alpha.41) (2026-01-27)
7
26
 
8
27
  **Note:** Version bump only for package @paperless/conventions
package/eslint.config.js CHANGED
@@ -7,6 +7,7 @@ import jsoncPlugin from 'eslint-plugin-jsonc';
7
7
  import prettierPlugin from 'eslint-plugin-prettier/recommended';
8
8
  import reactPlugin from 'eslint-plugin-react';
9
9
  import unicornPlugin from 'eslint-plugin-unicorn';
10
+ import earlyReturnPlugin from '@regru/eslint-plugin-prefer-early-return';
10
11
  import globals from 'globals';
11
12
  import typescriptPlugin from 'typescript-eslint';
12
13
 
@@ -36,7 +37,15 @@ export default defineConfig([
36
37
  {
37
38
  files: ['**/*.{ts,tsx,js,jsx}'],
38
39
  extends: [importPlugin.flatConfigs.recommended, unicornPlugin.configs.all],
40
+ plugins: { '@regru/prefer-early-return': earlyReturnPlugin },
39
41
  rules: {
42
+ 'no-else-return': 'error',
43
+ '@regru/prefer-early-return/prefer-early-return': [
44
+ 'error',
45
+ {
46
+ maximumStatements: 1,
47
+ },
48
+ ],
40
49
  'arrow-body-style': ['error', 'as-needed'],
41
50
  'unicorn/no-null': 'off',
42
51
  'unicorn/prevent-abbreviations': 'off',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paperless/conventions",
3
3
  "description": "Paperless eslint, typescript & prettier recommended configuration",
4
- "version": "2.22.0-alpha.41",
4
+ "version": "2.22.0-alpha.43",
5
5
  "license": "ISC",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -31,6 +31,7 @@
31
31
  "@angular-eslint/builder": "~19.0.0",
32
32
  "@eslint/js": "~9.39.1",
33
33
  "@nx/eslint-plugin": "~22.3.3",
34
+ "@regru/eslint-plugin-prefer-early-return": "~1.0.0",
34
35
  "angular-eslint": "~19.0.0",
35
36
  "eslint-config-prettier": "~10.1.8",
36
37
  "eslint-import-resolver-typescript": "~4.4.4",