@jterrazz/codestyle 1.2.4 → 1.2.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Jean-Baptiste Terrazzoni <contact@jterrazz.com>
3
+ Copyright (c) Jean-Baptiste Terrazzoni <contact@jterrazz.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -12,7 +12,7 @@ Create `.oxlintrc.json`:
12
12
 
13
13
  ```json
14
14
  {
15
- "extends": ["node_modules/@jterrazz/codestyle/src/oxlint/node.json"]
15
+ "extends": ["@jterrazz/codestyle/oxlint/node"]
16
16
  }
17
17
  ```
18
18
 
@@ -25,12 +25,12 @@ npx codestyle --fix # Fix everything
25
25
 
26
26
  ## Configurations
27
27
 
28
- | Config | Use Case |
29
- | -------------------------------------------------------------------------- | ---------------------------------- |
30
- | `node_modules/@jterrazz/codestyle/src/oxlint/node.json` | Node.js (requires .js extensions) |
31
- | `node_modules/@jterrazz/codestyle/src/oxlint/expo.json` | Expo / React Native |
32
- | `node_modules/@jterrazz/codestyle/src/oxlint/nextjs.json` | Next.js |
33
- | `node_modules/@jterrazz/codestyle/src/oxlint/architectures/hexagonal.json` | Hexagonal architecture enforcement |
28
+ | Config | Use Case |
29
+ | ---------------------------------------------------- | ---------------------------------- |
30
+ | `@jterrazz/codestyle/oxlint/node` | Node.js (requires .js extensions) |
31
+ | `@jterrazz/codestyle/oxlint/expo` | Expo / React Native |
32
+ | `@jterrazz/codestyle/oxlint/nextjs` | Next.js |
33
+ | `@jterrazz/codestyle/oxlint/architectures/hexagonal` | Hexagonal architecture enforcement |
34
34
 
35
35
  ## What's Included
36
36
 
@@ -59,8 +59,8 @@ Enforce hexagonal architecture boundaries:
59
59
  ```json
60
60
  {
61
61
  "extends": [
62
- "node_modules/@jterrazz/codestyle/src/oxlint/node.json",
63
- "node_modules/@jterrazz/codestyle/src/oxlint/architectures/hexagonal.json"
62
+ "@jterrazz/codestyle/oxlint/node",
63
+ "@jterrazz/codestyle/oxlint/architectures/hexagonal"
64
64
  ]
65
65
  }
66
66
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jterrazz/codestyle",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "author": "Jean-Baptiste Terrazzoni <contact@jterrazz.com>",
5
5
  "bin": {
6
6
  "codestyle": "./src/codestyle.sh"
@@ -23,27 +23,19 @@
23
23
  "registry": "https://registry.npmjs.org/"
24
24
  },
25
25
  "scripts": {
26
- "lint": "oxlint --ignore-pattern '**/fixtures/**' && oxfmt --check",
27
- "lint:fix": "oxlint --fix --ignore-pattern '**/fixtures/**' && oxfmt",
28
- "test": "vitest --run",
29
- "test:watch": "vitest",
30
- "build": "# no build script"
26
+ "build": "# no build script",
27
+ "lint": "./src/codestyle.sh --ignore-pattern '**/fixtures/**'",
28
+ "lint:fix": "./src/codestyle.sh --fix --ignore-pattern '**/fixtures/**'",
29
+ "test": "vitest --run"
31
30
  },
32
31
  "dependencies": {
33
- "@typescript/native-preview": "^7.0.0-dev",
34
- "eslint-plugin-perfectionist": "^4.15.1",
35
- "oxfmt": "^0.19.0",
36
- "oxlint": "^1.35.0"
32
+ "@jterrazz/typescript": "^4.2.1",
33
+ "eslint-plugin-perfectionist": "^5.2.0",
34
+ "oxfmt": "^0.21.0",
35
+ "oxlint": "^1.36.0"
37
36
  },
38
37
  "devDependencies": {
39
- "vitest": "^3.2.4"
40
- },
41
- "peerDependencies": {
42
- "@types/node": "*"
43
- },
44
- "peerDependenciesMeta": {
45
- "@types/node": {
46
- "optional": true
47
- }
38
+ "@types/node": "^25.0.3",
39
+ "vitest": "^4.0.16"
48
40
  }
49
41
  }
package/src/codestyle.sh CHANGED
@@ -14,26 +14,36 @@ RUN_LINT=false
14
14
  RUN_FORMAT=false
15
15
  RUN_ALL=true
16
16
  EXTRA_ARGS=()
17
+ LINT_ARGS=()
17
18
 
18
- for arg in "$@"; do
19
- case $arg in
19
+ while [[ $# -gt 0 ]]; do
20
+ case $1 in
20
21
  --fix)
21
22
  FIX_MODE=true
23
+ shift
22
24
  ;;
23
25
  --type)
24
26
  RUN_TYPE=true
25
27
  RUN_ALL=false
28
+ shift
26
29
  ;;
27
30
  --lint)
28
31
  RUN_LINT=true
29
32
  RUN_ALL=false
33
+ shift
30
34
  ;;
31
35
  --format)
32
36
  RUN_FORMAT=true
33
37
  RUN_ALL=false
38
+ shift
39
+ ;;
40
+ --ignore-pattern)
41
+ LINT_ARGS+=("$1" "$2")
42
+ shift 2
34
43
  ;;
35
44
  *)
36
- EXTRA_ARGS+=("$arg")
45
+ EXTRA_ARGS+=("$1")
46
+ shift
37
47
  ;;
38
48
  esac
39
49
  done
@@ -88,9 +98,9 @@ fi
88
98
 
89
99
  if [ "$RUN_LINT" = true ]; then
90
100
  if [ "$FIX_MODE" = true ]; then
91
- "$BIN_DIR/oxlint" --fix "${EXTRA_ARGS[@]:-.}" > "$tmp_dir/code.log" 2>&1 &
101
+ "$BIN_DIR/oxlint" --fix "${LINT_ARGS[@]}" "${EXTRA_ARGS[@]:-.}" > "$tmp_dir/code.log" 2>&1 &
92
102
  else
93
- "$BIN_DIR/oxlint" "${EXTRA_ARGS[@]:-.}" > "$tmp_dir/code.log" 2>&1 &
103
+ "$BIN_DIR/oxlint" "${LINT_ARGS[@]}" "${EXTRA_ARGS[@]:-.}" > "$tmp_dir/code.log" 2>&1 &
94
104
  fi
95
105
  code_pid=$!
96
106
  fi
@@ -48,7 +48,7 @@
48
48
  "type": "alphabetical",
49
49
  "order": "asc",
50
50
  "ignoreCase": true,
51
- "newlinesBetween": "always",
51
+ "newlinesBetween": 1,
52
52
  "groups": [
53
53
  ["builtin", "external"],
54
54
  "internal",