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

A small refactor #4837

Merged
merged 2 commits into from
Jun 22, 2020
Merged

A small refactor #4837

merged 2 commits into from
Jun 22, 2020

Conversation

m-allanson
Copy link
Member

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.

Which issue, if any, is this issue related to?

Related to issue #3935

Is there anything in the PR that needs further explanation?

This change is a small part of the changes in PR #4796

@m-allanson m-allanson mentioned this pull request Jun 21, 2020
14 tasks
@@ -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);
Copy link
Member Author

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;
Copy link
Member Author

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

Copy link
Member

@jeddy3 jeddy3 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!

Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

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

LGTM!

@m-allanson m-allanson merged commit 56a0108 into master Jun 22, 2020
@m-allanson m-allanson deleted the issue-3935/refactor-smaller-funcs branch June 22, 2020 15:02
m-allanson added a commit that referenced this pull request Jun 22, 2020
# By Mike Allanson (2) and others
* master:
  Fix changelog formatting
  A small refactor (#4837)
  Update CHANGELOG.md
  Add ignoreContextFunctionalPseudoClasses to selector-max-id (#4835)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants