Skip to content

Commit b8c3a0d

Browse files
committed
docs(putout) example of correct/incorrect code
1 parent ee1b246 commit b8c3a0d

117 files changed

Lines changed: 461 additions & 461 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codemods/apply-filter-boolean/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ npm i @putout/plugin-apply-filter-boolean
2121
}
2222
```
2323

24-
## Incorrect code example
24+
## Example of incorrect code
2525

2626
```ts
2727
array.filter((a) => a);
2828
```
2929

30-
## Correct code Example
30+
## Example of correct code
3131

3232
```ts
3333
array.filter(Boolean);

codemods/apply-replace-all/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ npm i @putout/plugin-apply-replace-all -D
2323

2424
## Rename
2525

26-
### Incorrect code example
26+
### Example of incorrect code
2727

2828
```js
2929
'h*ll*'.replace('*', 'x');
3030
```
3131

32-
### Correct code Example
32+
### Example of correct code
3333

3434
```js
3535
'h*ll*'.replace(/\*/g, 'x');

codemods/convert-any-to-primitive/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Rule `convert-any-to-primitive` is enabled by default for `ts` and `tsx` files,
2424
}
2525
```
2626

27-
## Incorrect code example
27+
## Example of incorrect code
2828

2929
```ts
3030
const x: any = 5;
3131
```
3232

33-
## Correct code Example
33+
## Example of correct code
3434

3535
```ts
3636
const x: number = 5;

codemods/convert-pascal-to-camel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mkdir ~/.putout
1111
ln -s ~/putout/codemods/convert-tape-to-supertape ~/.putout/convert-tape-to-supertape
1212
```
1313

14-
## Incorrect code example
14+
## Example of incorrect code
1515

1616
```js
1717
function HelloWorld() {
@@ -32,7 +32,7 @@ class SomeClass2 extends Component {
3232
}
3333
```
3434

35-
## Correct code Example
35+
## Example of correct code
3636

3737
```js
3838
function helloWorld() {

codemods/cut-legacy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ mkdir ~/.putout
1111
ln -s ~/putout/codemods/convert-tape-to-supertape ~/.putout/convert-tape-to-supertape
1212
```
1313

14-
## Incorrect code example
14+
## Example of incorrect code
1515

1616
```js
1717
const fullstore = require('fullstore/legacy');
1818
```
1919

20-
## Correct code Example
20+
## Example of correct code
2121

2222
```js
2323
const fullstore = require('fullstore');

codemods/cut-useless-functions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ npm i @putout/plugin-remove-useless-functions -D
2323

2424
## Rename
2525

26-
### Incorrect code example
26+
### Example of incorrect code
2727

2828
```js
2929
const y = (...a) => {
3030
alert(...a);
3131
};
3232
```
3333

34-
### Correct code Example
34+
### Example of correct code
3535

3636
```js
3737
const y = alert;

codemods/madrun/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ npm i putout @putout/plugin-madrun -D
2727

2828
# add-madrun-to-lint
2929

30-
## Incorrect code example
30+
## Example of incorrect code
3131

3232
```js
3333
module.exports = {
3434
lint: () => `eslint lib test --ignore-pattern test/fixture`,
3535
};
3636
```
3737

38-
## Correct code Example
38+
## Example of correct code
3939

4040
```js
4141
module.exports = {
@@ -45,7 +45,7 @@ module.exports = {
4545

4646
# rename-predefined-eslint-to-putout
4747

48-
## Incorrect code example
48+
## Example of incorrect code
4949

5050
```js
5151
const {eslint} = predefined;
@@ -64,7 +64,7 @@ module.exports = {
6464
};
6565
```
6666

67-
## Correct code Example
67+
## Example of correct code
6868

6969
```js
7070
const {putout} = predefined;
@@ -85,7 +85,7 @@ module.exports = {
8585

8686
# add-fresh-lint
8787

88-
## Incorrect code example
88+
## Example of incorrect code
8989

9090
```js
9191
const {run} = require('madrun');
@@ -95,7 +95,7 @@ module.exports = {
9595
};
9696
```
9797

98-
## Correct code Example
98+
## Example of correct code
9999

100100
```js
101101
const {run} = require('madrun');

packages/engine-processor/test/fixture/no-places-no-change.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ npm i @putout/plugin-apply-replace-all -D
2323

2424
## Rename
2525

26-
### Incorrect code example
26+
### Example of incorrect code
2727

2828
```js
2929
'h*ll*'.replace('*', 'x');
3030
```
3131

32-
### Correct code Example
32+
### Example of correct code
3333

3434
```js
3535
'h*ll*'.replace(/\*/g, 'x');

packages/eslint-plugin-putout/lib/function-declaration-paren-newline/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Remove newlines between parens in function declaration. Similar to `ESLint` rule [function-paren-newline](https://eslint.org/docs/rules/function-declaration-paren-newline), but forbids new lines in function declarations and expressions arguments.
44
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
55

6-
## Incorrect code example
6+
## Example of incorrect code
77

88
```js
99
function f(
@@ -23,7 +23,7 @@ regexpTree.traverse(ast, {
2323
});
2424
```
2525

26-
## Correct code example
26+
## Example of correct code
2727

2828
```js
2929
function f({a, b, c}) {}

packages/eslint-plugin-putout/lib/remove-empty-newline-after-last-element/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Remove empty newline after last element.
44
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
55

6-
## Incorrect code example
6+
## Example of incorrect code
77

88
```js
99
push([
@@ -13,7 +13,7 @@ push([
1313
]);
1414
```
1515

16-
## Correct code example
16+
## Example of correct code
1717

1818
```js
1919
push([

0 commit comments

Comments
 (0)