Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add missing images #16017

Merged
merged 3 commits into from Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/.eleventy.js
Expand Up @@ -316,6 +316,10 @@ module.exports = function(eleventyConfig) {
"./node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js": "/assets/js/algoliasearch.js"
});

eleventyConfig.addPassthroughCopy({
"./src/developer-guide/**/*.svg": "/assets/images"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this to make sure for images other than this one?

Suggested change
"./src/developer-guide/**/*.svg": "/assets/images"
"./src/**/**/*.svg": "/assets/images"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just move these image to the central folder, /assets/images? @mdjermanovic what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just move these image to the central folder, /assets/images? @mdjermanovic what do you think?

Yeah, it might be best to just move them to /assets/images. We could then make subdirectories /assets/images/architecture and /assets/images/code-path-analysis.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

});

//------------------------------------------------------------------------------
// Collections
//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/architecture/index.md
Expand Up @@ -5,7 +5,7 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/a

---

<center><img alt="dependency graph" src="dependency.svg"></center>
<center><img alt="dependency graph" src="./../../assets/images/dependency.svg"></center>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could implement aliases by some how so that we can use images/dependency.svg instead of adding the complete links


At a high level, there are a few key parts to ESLint:

Expand Down
48 changes: 24 additions & 24 deletions docs/src/developer-guide/code-path-analysis.md
Expand Up @@ -16,7 +16,7 @@ if (a && b) {
bar();
```

![Code Path Example](./code-path-analysis/helo.svg)
![Code Path Example](./../assets/images/helo.svg)

## Objects

Expand Down Expand Up @@ -145,17 +145,17 @@ bar();

1. First, the analysis advances to the end of loop.

![Loop Event's Example 1](./code-path-analysis/loop-event-example-while-1.svg)
![Loop Event's Example 1](./../assets/images/loop-event-example-while-1.svg)

2. Second, it creates the looping path.
At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
It fires `onCodePathSegmentLoop` instead.

![Loop Event's Example 2](./code-path-analysis/loop-event-example-while-2.svg)
![Loop Event's Example 2](./../assets/images/loop-event-example-while-2.svg)

3. Last, it advances to the end.

![Loop Event's Example 3](./code-path-analysis/loop-event-example-while-3.svg)
![Loop Event's Example 3](./../assets/images/loop-event-example-while-3.svg)

For example 2:

Expand All @@ -170,29 +170,29 @@ bar();
First, the analysis advances to `ForStatement.update`.
The `update` segment is hovered at first.

![Loop Event's Example 1](./code-path-analysis/loop-event-example-for-1.svg)
![Loop Event's Example 1](./../assets/images/loop-event-example-for-1.svg)

2. Second, it advances to `ForStatement.body`.
Of course the `body` segment is preceded by the `test` segment.
It keeps the `update` segment hovering.

![Loop Event's Example 2](./code-path-analysis/loop-event-example-for-2.svg)
![Loop Event's Example 2](./../assets/images/loop-event-example-for-2.svg)

3. Third, it creates the looping path from `body` segment to `update` segment.
At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
It fires `onCodePathSegmentLoop` instead.

![Loop Event's Example 3](./code-path-analysis/loop-event-example-for-3.svg)
![Loop Event's Example 3](./../assets/images/loop-event-example-for-3.svg)

4. Fourth, also it creates the looping path from `update` segment to `test` segment.
At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
It fires `onCodePathSegmentLoop` instead.

![Loop Event's Example 4](./code-path-analysis/loop-event-example-for-4.svg)
![Loop Event's Example 4](./../assets/images/loop-event-example-for-4.svg)

5. Last, it advances to the end.

![Loop Event's Example 5](./code-path-analysis/loop-event-example-for-5.svg)
![Loop Event's Example 5](./../assets/images/loop-event-example-for-5.svg)

## Usage Examples

Expand Down Expand Up @@ -338,7 +338,7 @@ See Also:
console.log("Hello world!");
```

![Hello World](./code-path-analysis/example-hello-world.svg)
![Hello World](./../assets/images/example-hello-world.svg)

### `IfStatement`

Expand All @@ -350,7 +350,7 @@ if (a) {
}
```

![`IfStatement`](./code-path-analysis/example-ifstatement.svg)
![`IfStatement`](./../assets/images/example-ifstatement.svg)

### `IfStatement` (chain)

Expand All @@ -364,7 +364,7 @@ if (a) {
}
```

![`IfStatement` (chain)](./code-path-analysis/example-ifstatement-chain.svg)
![`IfStatement` (chain)](./../assets/images/example-ifstatement-chain.svg)

### `SwitchStatement`

Expand All @@ -385,7 +385,7 @@ switch (a) {
}
```

![`SwitchStatement`](./code-path-analysis/example-switchstatement.svg)
![`SwitchStatement`](./../assets/images/example-switchstatement.svg)

### `SwitchStatement` (has `default`)

Expand All @@ -410,7 +410,7 @@ switch (a) {
}
```

![`SwitchStatement` (has `default`)](./code-path-analysis/example-switchstatement-has-default.svg)
![`SwitchStatement` (has `default`)](./../assets/images/example-switchstatement-has-default.svg)

### `TryStatement` (try-catch)

Expand All @@ -433,7 +433,7 @@ It creates the paths from `try` block to `catch` block at:
* The first throwable node (e.g. a function call) in the `try` block.
* The end of the `try` block.

![`TryStatement` (try-catch)](./code-path-analysis/example-trystatement-try-catch.svg)
![`TryStatement` (try-catch)](./../assets/images/example-trystatement-try-catch.svg)

### `TryStatement` (try-finally)

Expand All @@ -451,7 +451,7 @@ If there is not `catch` block, `finally` block has two current segments.
At this time, `CodePath.currentSegments.length` is `2`.
One is the normal path, and another is the leaving path (`throw` or `return`).

![`TryStatement` (try-finally)](./code-path-analysis/example-trystatement-try-finally.svg)
![`TryStatement` (try-finally)](./../assets/images/example-trystatement-try-finally.svg)

### `TryStatement` (try-catch-finally)

Expand All @@ -467,7 +467,7 @@ try {
last();
```

![`TryStatement` (try-catch-finally)](./code-path-analysis/example-trystatement-try-catch-finally.svg)
![`TryStatement` (try-catch-finally)](./../assets/images/example-trystatement-try-catch-finally.svg)

### `WhileStatement`

Expand All @@ -481,7 +481,7 @@ while (a) {
}
```

![`WhileStatement`](./code-path-analysis/example-whilestatement.svg)
![`WhileStatement`](./../assets/images/example-whilestatement.svg)

### `DoWhileStatement`

Expand All @@ -492,7 +492,7 @@ do {
} while (a);
```

![`DoWhileStatement`](./code-path-analysis/example-dowhilestatement.svg)
![`DoWhileStatement`](./../assets/images/example-dowhilestatement.svg)

### `ForStatement`

Expand All @@ -506,7 +506,7 @@ for (let i = 0; i < 10; ++i) {
}
```

![`ForStatement`](./code-path-analysis/example-forstatement.svg)
![`ForStatement`](./../assets/images/example-forstatement.svg)

### `ForStatement` (for ever)

Expand All @@ -517,7 +517,7 @@ for (;;) {
bar();
```

![`ForStatement` (for ever)](./code-path-analysis/example-forstatement-for-ever.svg)
![`ForStatement` (for ever)](./../assets/images/example-forstatement-for-ever.svg)

### `ForInStatement`

Expand All @@ -527,7 +527,7 @@ for (let key in obj) {
}
```

![`ForInStatement`](./code-path-analysis/example-forinstatement.svg)
![`ForInStatement`](./../assets/images/example-forinstatement.svg)

### When there is a function

Expand All @@ -546,8 +546,8 @@ It creates two code paths.

* The global's

![When there is a function](./code-path-analysis/example-when-there-is-a-function-g.svg)
![When there is a function](./../assets/images/example-when-there-is-a-function-g.svg)

* The function's

![When there is a function](./code-path-analysis/example-when-there-is-a-function-f.svg)
![When there is a function](./../assets/images/example-when-there-is-a-function-f.svg)