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
Docs: update architecture page (fixes #9337) #9345
Docs: update architecture page (fixes #9337) #9345
Conversation
@VictorHom, thanks for your PR! By analyzing the history of the files in this pull request, we identified @not-an-aardvark, @nzakas and @alberto to be potential reviewers. |
LGTM |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM, just one small change request and one comment. Thanks for contributing!
docs/developer-guide/architecture.md
Outdated
@@ -4,7 +4,10 @@ At a high level, there are a few key parts to ESLint: | |||
|
|||
* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing. | |||
* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output. | |||
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | |||
* `lib/linter.js` - this is the core `eslint` object that does code verifying based on configuration options by exporting a class Linter. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter is now a class, so perhaps you might wish to say something like: "this is the core Linter
class that does code verifying..."
docs/developer-guide/architecture.md
Outdated
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | ||
* `lib/linter.js` - this is the core `eslint` object that does code verifying based on configuration options by exporting a class Linter. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | ||
* `lib/api.js` - this exposes an object that contains Linter, CLIEngine, RuleTester, and SourceCode. | ||
* `lib/testers/rule-tester.js` - this is a wrapper around mocha, so that rules can be unit tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth noting here that rule-tester can be modified to wrap any testing framework, but that it happens to work with Mocha's global testing methods by default and that its interface was modeled after Mocha. (Not sure how best to phrase it, though.)
LGTM |
docs/developer-guide/architecture.md
Outdated
@@ -4,7 +4,10 @@ At a high level, there are a few key parts to ESLint: | |||
|
|||
* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing. | |||
* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output. | |||
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | |||
* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options by exporting a class Linter. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"this is the core Linter class...by exporting a class Linter".
Can we make this clearer? I personally think this is the core Linter class that does code verifying based on configuration options.
is adequate.
docs/developer-guide/architecture.md
Outdated
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | ||
* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options by exporting a class Linter. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | ||
* `lib/api.js` - this exposes an object that contains Linter, CLIEngine, RuleTester, and SourceCode. | ||
* `lib/testers/rule-tester.js` - this is a wrapper around Mocha, so that rules can be unit tested. The RuleTester interface was modeled after Mocha and works with the Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"this is a wrapper around Mocha, so that rules can be unit tested."
Can we describe why this class is useful?
"was modeled after Mocha and works with the Mocha's global testing methods"
Extra the
.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
docs/developer-guide/architecture.md
Outdated
@@ -4,7 +4,10 @@ At a high level, there are a few key parts to ESLint: | |||
|
|||
* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing. | |||
* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output. | |||
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. | |||
* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options by exporting a class Linter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies, I should have been clearer in my comment. The part that I think is confusing is the part that says "this is the core Linter class that does things by exporting a class Linter."
. I think the rest of the information is useful! Here's what I was trying to suggest (sorry it wasn't clearer!) in my last comment:
* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for contributing!
What is the purpose of this pull request? (put an "X" next to item)
update the architecture page on https://eslint.org/docs/developer-guide/architecture
[X] Documentation update
Is there anything you'd like reviewers to focus on?
I haven't worked with all of those files before that are mentioned in the doc update, so if there's anything reviewers think would be important to add, please let me know. Happy to update.