-
Notifications
You must be signed in to change notification settings - Fork 9
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(blog): New Blogpost #348
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Just left some comments :)
Good read, I enjoyed it!
|
||
{/* truncate */} | ||
|
||
I wanted to give a glimpse into the architectural design decisions going on in Sheriff behind the scenes, so I'm sharing a deep dive into the [Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) principle and how it helped Sheriff achieve a more flexible and accessible options API. |
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.
I wanted to give a glimpse into the architectural design decisions going on in Sheriff behind the scenes, so I'm sharing a deep dive into the [Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) principle and how it helped Sheriff achieve a more flexible and accessible options API. | |
I wanted to give a glimpse into the architectural design decisions going on behind the scenes in Sheriff, so I'm sharing a deep dive into the [Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) principle and how it helps Sheriff achieve a more flexible and accessible API. |
|
||
:::info | ||
|
||
I know, Inversion of Control is an expression that can have many different meanings in computer programming, depending on the context, but in this article I'm using it in loose terms to describe the process of giving the user more control over the library's behavior. |
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.
I know, Inversion of Control is an expression that can have many different meanings in computer programming, depending on the context, but in this article I'm using it in loose terms to describe the process of giving the user more control over the library's behavior. | |
I know that *Inversion of Control* has many meanings in computer programming, but I'm using here it to describe the process of giving the user more control over the library's behavior. |
|
||
## Why | ||
|
||
One of the coolest things about Sheriff is the way it encapsulates the complexity of ESLint and its ecosystem, most of the times hiding the ugly details behind the curtains. The problem is that sometimes the level of abstraction is too intrusive and can obstacolate the user's ability to customize the configuration to their needs. It's a delicate balance to strike. |
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.
One of the coolest things about Sheriff is the way it encapsulates the complexity of ESLint and its ecosystem, most of the times hiding the ugly details behind the curtains. The problem is that sometimes the level of abstraction is too intrusive and can obstacolate the user's ability to customize the configuration to their needs. It's a delicate balance to strike. | |
One of the coolest things about Sheriff is the way it encapsulates the complexity of ESLint and its ecosystem, mostly hiding the ugly details behind a curtain. The problem is, sometimes the level of abstraction is too intrusive and can interfere with users' ability to customize the configuration to suit their needs. It's a delicate balance to strike. |
|
||
One of the coolest things about Sheriff is the way it encapsulates the complexity of ESLint and its ecosystem, most of the times hiding the ugly details behind the curtains. The problem is that sometimes the level of abstraction is too intrusive and can obstacolate the user's ability to customize the configuration to their needs. It's a delicate balance to strike. | ||
|
||
In this article we will explore why the Inversion of Control principle is often the key to unlock the best solution. |
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.
In this article we will explore why the Inversion of Control principle is often the key to unlock the best solution. | |
In this article, we will explore how Sheriff uses the *Inversion of Control* principle as the key to unlocking the best APIs. |
|
||
### The problem | ||
|
||
ESLint offers a rule called [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax) that allows you to disallow specific Javascript syntax features. |
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.
ESLint offers a rule called [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax) that allows you to disallow specific Javascript syntax features. | |
ESLint offers a rule called [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax) that allows you to disallow specific JavaScript syntax features. |
|
||
### Going forward | ||
|
||
Since then the typescript-eslint team moved to a new option called [`projectService`](https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta#project-service). |
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.
Since then the typescript-eslint team moved to a new option called [`projectService`](https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta#project-service). | |
Since then, the typescript-eslint team has moved to a new system called the [project service](https://typescript-eslint.io/blog/announcing-typescript-eslint-v8#project-service). |
|
||
Since then the typescript-eslint team moved to a new option called [`projectService`](https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta#project-service). | ||
|
||
This option is meant to definitely get rid of the need for the custom tsconfigs, like `tsconfig.eslint.json` etc, that some users had for some advanced use-cases. It also has other benefits. [Learn more](https://typescript-eslint.io/packages/parser#projectservice). |
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 option is meant to definitely get rid of the need for the custom tsconfigs, like `tsconfig.eslint.json` etc, that some users had for some advanced use-cases. It also has other benefits. [Learn more](https://typescript-eslint.io/packages/parser#projectservice). | |
This option is meant to get rid of the need for custom `tsconfig.json`s like `tsconfig.eslint.json`, etc., that some users had made for advanced use cases. The project service also has other benefits, and is often more performant. [Learn more](https://typescript-eslint.io/packages/parser#projectservice). |
|
||
This option is meant to definitely get rid of the need for the custom tsconfigs, like `tsconfig.eslint.json` etc, that some users had for some advanced use-cases. It also has other benefits. [Learn more](https://typescript-eslint.io/packages/parser#projectservice). | ||
|
||
Sheriff is currently exploring on adopting this new API ([Issue](https://github.com/AndreaPontrandolfo/sheriff/issues/203) | [PR](https://github.com/AndreaPontrandolfo/sheriff/pull/205)), but it seems like the feature is still experimental and [has some issues to iron out first](https://github.com/microsoft/vscode-eslint/issues/1911). |
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.
Sheriff is currently exploring on adopting this new API ([Issue](https://github.com/AndreaPontrandolfo/sheriff/issues/203) | [PR](https://github.com/AndreaPontrandolfo/sheriff/pull/205)), but it seems like the feature is still experimental and [has some issues to iron out first](https://github.com/microsoft/vscode-eslint/issues/1911). | |
Sheriff is currently exploring on adopting this new API ([issue](https://github.com/AndreaPontrandolfo/sheriff/issues/203) | [PR](https://github.com/AndreaPontrandolfo/sheriff/pull/205)). |
The linked issue states that the project service is now more correct than the old version (in typescript-eslint
>=8.3.0
), although the issue remains open until issues (that also exist with the current version) are fixed. It's also no longer experimental in typescript-eslint v8, but has been stabilized.
|
||
## Conclusion | ||
|
||
By simplifying APIs and empowering advanced users with more granular controls, Sheriff strikes a balance between ease of use and developer freedom. As the library evolves, it remains committed to enhancing developer experience with modern, user-focused solutions. |
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.
By simplifying APIs and empowering advanced users with more granular controls, Sheriff strikes a balance between ease of use and developer freedom. As the library evolves, it remains committed to enhancing developer experience with modern, user-focused solutions. | |
By simplifying APIs and empowering users with more granular controls, Sheriff seeks to strike a balance between ease of use and developer freedom. As the library evolves, we remain committed to enhancing developer experience with modern, user-focused solutions. |
- [ESLint >=9.0.0](https://eslint.org/) | ||
- [Typescript >= 5.0.0](https://www.typescriptlang.org/) |
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.
These are already listed in the minimums. I think we do want to recommend newer versions though, perhaps this?:
- [ESLint >=9.0.0](https://eslint.org/) | |
- [Typescript >= 5.0.0](https://www.typescriptlang.org/) | |
- [ESLint >=9.5.0](https://eslint.org/) | |
- [Typescript >= 5.7.0](https://www.typescriptlang.org/) |
b/c 9.5 introduced language plugins and is the version ESLint tooling depends on, and 5.7 b/c it's needed for @types/node@>=22.7.3
.
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.
Also, I think this will conflict with #305.
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.
i basically "duplicated" here these requirements because it felt odd not having the hard requirements as a base for the recommended requirements. I mean, they are intended as a base of course, but making it explicit avoid any confusion i think.
Fixes #347