Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit 3be9484

Browse files
refactor: Extract documentation examples from tests
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.recipes.ExamplesExtractor?organizationId=ODQ2MGExMTUtNDg0My00N2EwLTgzMGMtNGE1NGExMTBmZDkw Co-authored-by: Moderne <team@moderne.io>
1 parent e88a1a0 commit 3be9484

File tree

1 file changed

+54
-0
lines changed
  • rewrite-javascript/src/main/resources/META-INF/rewrite

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2025 the original author or authors.
2+
# <p>
3+
# Licensed under the Moderne Source Available License (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
# <p>
7+
# https://docs.moderne.io/licensing/moderne-source-available-license
8+
# <p>
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
---
16+
type: specs.openrewrite.org/v1beta/example
17+
recipeName: org.openrewrite.javascript.cleanup.UseCaseFallThrough
18+
examples:
19+
- description: ''
20+
sources:
21+
- before: |
22+
function foo(x) {
23+
switch (x) {
24+
case "a" || "b" || "c":
25+
console.log("1");
26+
break;
27+
default:
28+
console.log("default");
29+
}
30+
}
31+
after: |
32+
function foo(x) {
33+
switch (x) {
34+
case "a":
35+
case "b":
36+
case "c":
37+
console.log("1");
38+
break;
39+
default:
40+
console.log("default");
41+
}
42+
}
43+
language: javaScript
44+
---
45+
type: specs.openrewrite.org/v1beta/example
46+
recipeName: org.openrewrite.staticanalysis.SimplifyBooleanExpression
47+
examples:
48+
- description: ''
49+
sources:
50+
- before: |
51+
const b = !false
52+
after: |
53+
const b = true
54+
language: javaScript

0 commit comments

Comments
 (0)