Updated SC2113 (markdown)

haruna
2021-05-21 03:56:10 +09:00
parent 6de8c5f56c
commit 9770403af4

@@ -1,4 +1,8 @@
Instead of ## `function` keyword is non-standard. Use `foo()` instead of `function foo`.
### Problematic code:
In `sh`,
```sh ```sh
function quit { function quit {
@@ -6,11 +10,22 @@ function quit {
} }
``` ```
...add the parenthesis to the function name and remove the word "function": ### Correct code:
1. add `()` to after the function name. _this code newly cause [[SC2113]]._
```sh
function quit() {
exit
}
#=> SC2112: 'function' keyword is non-standard. Delete it.
```
2. remove `function`
```sh ```sh
quit() { quit() {
exit exit
} }
#=> No issues detected!
``` ```