@tucchi-/eslint-config 1.5.0 → 1.7.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/index.js CHANGED
@@ -34,6 +34,10 @@ export default function modernConfig(options = {}) {
34
34
  // Variable declarations
35
35
  "prefer-const": "error", // const > let
36
36
  "no-var": "error", // no var
37
+ "no-restricted-syntax": [
38
+ "error",
39
+ { selector: "VariableDeclaration[kind='let']", message: "Use const instead of let" },
40
+ ],
37
41
 
38
42
  // Function style
39
43
  "func-style": ["error", "expression"], // arrow function > function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tucchi-/eslint-config",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Modern ESLint config with TypeScript strict, unicorn, and complexity rules",
5
5
  "author": "tucchi-",
6
6
  "license": "MIT",
@@ -11,7 +11,9 @@
11
11
  },
12
12
  "files": [
13
13
  "index.js",
14
- "tsconfig.recommended.json"
14
+ "tsconfig.recommended.json",
15
+ "ruleset.json",
16
+ "scripts/protect-branch.sh"
15
17
  ],
16
18
  "keywords": [
17
19
  "eslint",
@@ -34,6 +36,6 @@
34
36
  "typescript-eslint": "^8.0.0"
35
37
  },
36
38
  "devDependencies": {
37
- "@tucchi-/eslint-config": "1.4.0"
39
+ "@tucchi-/eslint-config": "1.6.0"
38
40
  }
39
41
  }
package/ruleset.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "main-protection",
3
+ "target": "branch",
4
+ "enforcement": "active",
5
+ "bypass_actors": [
6
+ {
7
+ "actor_id": 5,
8
+ "actor_type": "RepositoryRole",
9
+ "bypass_mode": "always"
10
+ }
11
+ ],
12
+ "conditions": {
13
+ "ref_name": {
14
+ "exclude": [],
15
+ "include": ["refs/heads/main"]
16
+ }
17
+ },
18
+ "rules": [
19
+ {
20
+ "type": "required_linear_history"
21
+ },
22
+ {
23
+ "type": "non_fast_forward"
24
+ },
25
+ {
26
+ "type": "deletion"
27
+ },
28
+ {
29
+ "type": "required_status_checks",
30
+ "parameters": {
31
+ "strict_required_status_checks_policy": true,
32
+ "required_status_checks": [
33
+ { "context": "check" },
34
+ { "context": "build" },
35
+ { "context": "test" }
36
+ ]
37
+ }
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ # Apply standard branch protection ruleset
3
+ # Usage: ./scripts/protect-branch.sh [owner/repo]
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
+ REPO=${1:-$(gh repo view --json nameWithOwner -q .nameWithOwner)}
9
+
10
+ gh api "repos/$REPO/rulesets" -X POST --input "$SCRIPT_DIR/../ruleset.json"
11
+
12
+ echo "✓ Ruleset applied to $REPO"