-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
A small refactor #4837
A small refactor #4837
Conversation
@@ -40,25 +43,7 @@ module.exports = function (stylelint, options = {}) { | |||
let syntax = null; | |||
|
|||
if (stylelint._options.customSyntax) { | |||
try { | |||
// TODO TYPES determine which type has customSyntax | |||
const customSyntax = /** @type {any} */ require(stylelint._options.customSyntax); |
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 now using the type @typedef {import('postcss').Syntax} Syntax
@@ -90,6 +90,8 @@ declare module 'stylelint' { | |||
|
|||
export type FormatterIdentifier = 'compact' | 'json' | 'string' | 'unix' | 'verbose' | Formatter; | |||
|
|||
export type CustomSyntax = string; |
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 type will be extended later to be string | Syntax
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!
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!
Another refactor. This moves a couple of chunks of functionality out to separate functions. It's not particularly essential, but (imo) makes it easier to understand what's happening in each file.
This should be the last bit of refactoring from PR #4796. The remaining follow-on PRs should result in new (or changed) functionality instead of rearranging internals.
Related to issue #3935
This change is a small part of the changes in PR #4796