eslint-plugin-code-style 1.0.40 → 1.0.41

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.
Files changed (3) hide show
  1. package/README.md +22 -0
  2. package/index.js +7 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -890,44 +890,66 @@ useEffect(() => {}, [
890
890
  // ✅ Good — consistent formatting
891
891
  if (condition) {
892
892
  doSomething();
893
+
894
+ doMore();
893
895
  }
894
896
 
895
897
  if (condition) {
896
898
  doSomething();
899
+
900
+ doMore();
897
901
  } else {
898
902
  doOther();
903
+
904
+ doAnother();
899
905
  }
900
906
 
901
907
  if (conditionA) {
902
908
  handleA();
909
+
910
+ processA();
903
911
  } else if (conditionB) {
904
912
  handleB();
913
+
914
+ processB();
905
915
  } else {
906
916
  handleDefault();
917
+
918
+ processDefault();
907
919
  }
908
920
 
909
921
  // ❌ Bad — brace on new line
910
922
  if (condition)
911
923
  {
912
924
  doSomething();
925
+
926
+ doMore();
913
927
  }
914
928
 
915
929
  // ❌ Bad — else on new line
916
930
  if (condition) {
917
931
  doSomething();
932
+
933
+ doMore();
918
934
  }
919
935
  else {
920
936
  doOther();
937
+
938
+ doAnother();
921
939
  }
922
940
 
923
941
  // ❌ Bad — inconsistent formatting
924
942
  if (condition)
925
943
  {
926
944
  doSomething();
945
+
946
+ doMore();
927
947
  }
928
948
  else
929
949
  {
930
950
  doOther();
951
+
952
+ doAnother();
931
953
  }
932
954
  ```
933
955
 
package/index.js CHANGED
@@ -2128,21 +2128,28 @@ const hookDepsPerLine = {
2128
2128
  * opening brace on the same line as the condition and else
2129
2129
  * on the same line as the closing brace.
2130
2130
  *
2131
+ *
2131
2132
  * ✓ Good:
2132
2133
  * if (condition) {
2133
2134
  * doSomething();
2135
+ *
2136
+ * doMore();
2134
2137
  * } else {
2135
2138
  * doOther();
2139
+ *
2140
+ * doAnother();
2136
2141
  * }
2137
2142
  *
2138
2143
  * ✗ Bad:
2139
2144
  * if (condition)
2140
2145
  * {
2141
2146
  * doSomething();
2147
+ * doMore();
2142
2148
  * }
2143
2149
  * else
2144
2150
  * {
2145
2151
  * doOther();
2152
+ * doAnother();
2146
2153
  * }
2147
2154
  */
2148
2155
  const ifStatementFormat = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-code-style",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "A custom ESLint plugin for enforcing consistent code formatting and style rules in React/JSX projects",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",