Skip to content

Commit ff181bd

Browse files
committed
Use consistent semicolon-less style in readmes
1 parent 2ab6cf8 commit ff181bd

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

acorn-loose/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ placeholders in places where it can't make sense of the input. Depends
4949
on the `acorn` package, because it uses the same tokenizer.
5050

5151
```javascript
52-
import * as acornLoose from "acorn-loose";
53-
console.log(acornLoose.parse("1 / * 4 )[2]", {ecmaVersion: 2020}));
52+
import * as acornLoose from "acorn-loose"
53+
console.log(acornLoose.parse("1 / * 4 )[2]", {ecmaVersion: 2020}))
5454
```
5555

5656
Like the regular parser, the loose parser supports plugins. You can

acorn-walk/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,29 @@ produce a meaningful state. (An example of a use of state is to track
4747
scope at each point in the tree.)
4848

4949
```js
50-
import * as acorn from "acorn";
51-
import * as walk from "acorn-walk";
50+
import * as acorn from "acorn"
51+
import * as walk from "acorn-walk"
5252

5353
walk.simple(acorn.parse("let x = 10"), {
5454
Literal(node) {
55-
console.log(`Found a literal: ${node.value}`);
55+
console.log(`Found a literal: ${node.value}`)
5656
}
57-
});
57+
})
5858
```
5959

6060
**ancestor**`(node, visitors, base, state)` does a 'simple' walk over
6161
a tree, building up an array of ancestor nodes (including the current node)
6262
and passing the array to the callbacks as a third parameter.
6363

6464
```js
65-
import * as acorn from "acorn";
66-
import * as walk from "acorn-walk";
65+
import * as acorn from "acorn"
66+
import * as walk from "acorn-walk"
6767

6868
walk.ancestor(acorn.parse("foo('hi')"), {
6969
Literal(_node, _state, ancestors) {
70-
console.log("This literal's ancestors are:", ancestors.map(n => n.type));
70+
console.log("This literal's ancestors are:", ancestors.map(n => n.type))
7171
}
72-
});
72+
})
7373
```
7474

7575
**recursive**`(node, state, functions, base)` does a 'recursive'
@@ -97,12 +97,12 @@ current node) and passing the array to the callbacks as a third
9797
parameter.
9898

9999
```js
100-
import * as acorn from "acorn";
101-
import * as walk from "acorn-walk";
100+
import * as acorn from "acorn"
101+
import * as walk from "acorn-walk"
102102

103103
walk.full(acorn.parse("1 + 1"), node => {
104-
console.log(`There's a ${node.type} node at ${node.ch}`);
105-
});
104+
console.log(`There's a ${node.type} node at ${node.ch}`)
105+
})
106106
```
107107

108108
**findNodeAt**`(node, start, end, test, base, state)` tries to locate

acorn/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ ESM as well as CommonJS is supported for all 3: `acorn`, `acorn-walk` and `acorn
3333
ESM example for `acorn`:
3434

3535
```js
36-
import * as acorn from "acorn";
36+
import * as acorn from "acorn"
3737
```
3838

3939
CommonJS example for `acorn`:
4040

4141
```js
42-
let acorn = require("acorn");
42+
let acorn = require("acorn")
4343
```
4444

4545
ESM is preferred, as it allows better editor auto-completions by offering TypeScript support.
@@ -54,8 +54,8 @@ syntax tree object as specified by the [ESTree
5454
spec](https://github.com/estree/estree).
5555

5656
```javascript
57-
import * as acorn from "acorn";
58-
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
57+
import * as acorn from "acorn"
58+
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
5959
```
6060

6161
When encountering a syntax error, the parser will raise a
@@ -236,7 +236,7 @@ for (let token of acorn.tokenizer(str)) {
236236
}
237237

238238
// transform code to array of tokens:
239-
var tokens = [...acorn.tokenizer(str)];
239+
var tokens = [...acorn.tokenizer(str)]
240240
```
241241

242242
**tokTypes** holds an object mapping names to the token type objects
@@ -257,10 +257,10 @@ on the extended version of the class. To extend a parser with plugins,
257257
you can use its static `extend` method.
258258

259259
```javascript
260-
var acorn = require("acorn");
261-
var jsx = require("acorn-jsx");
262-
var JSXParser = acorn.Parser.extend(jsx());
263-
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
260+
var acorn = require("acorn")
261+
var jsx = require("acorn-jsx")
262+
var JSXParser = acorn.Parser.extend(jsx())
263+
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
264264
```
265265

266266
The `extend` method takes any number of plugin values, and returns a

0 commit comments

Comments
 (0)