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

Docs: update architecture page (fixes #9337) #9345

Merged
merged 5 commits into from Sep 28, 2017

Conversation

VictorHom
Copy link
Member

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.

@mention-bot
Copy link

@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.

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a 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!

@@ -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.
Copy link
Member

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..."

* `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.
Copy link
Member

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.)

@not-an-aardvark not-an-aardvark added the documentation Relates to ESLint's documentation label Sep 23, 2017
@eslintbot
Copy link

LGTM

@@ -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.
Copy link
Member

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.

* `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.
Copy link
Member

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.

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@@ -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.
Copy link
Member

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.

@eslintbot
Copy link

LGTM

Copy link
Member

@kaicataldo kaicataldo left a 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!

@kaicataldo kaicataldo merged commit 458ca67 into eslint:master Sep 28, 2017
@VictorHom VictorHom deleted the pr/update_architecture_doc branch September 29, 2017 01:51
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 28, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants