-
-
Notifications
You must be signed in to change notification settings - Fork 946
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
Fix some tests that use callbacks #4970
Conversation
} | ||
d {} | ||
`; | ||
a {} |
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.
Could increase all template literal content indentation by one level? So it look nicer :)
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.
Agreed. I'll fix the template literals in other files in another PR. 💪
postcss.parse(css).walkRules((rule) => { | ||
parseSelector((selectorAST) => { | ||
selectorAST.walkPseudos(cb); | ||
selectorAST.walkPseudos((pseudo) => pseudos.push(pseudo)); |
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.
Parameter pseudo
is the same as function name pseudo
. Maybe rename function to pseudoClass
to avoid potential hard to find bugs.
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.
Good catch! ESLint's no-shadow
rule may reduce our review cost:
$ npx eslint --rule "no-shadow: 2" lib/utils/__tests__/isContextFunctionalPseudoClass.test.js
/tmp/stylelint/lib/utils/__tests__/isContextFunctionalPseudoClass.test.js
12:29 error 'pseudo' is already declared in the upper scope no-shadow
✖ 1 problem (1 error, 0 warnings)
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've opened #4985 about the `no-shadow- rule.
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!
* master: (46 commits) Update CHANGELOG.md Add ignoreAtRules to property-no-unknown (#4965) Bump eslint from 7.11.0 to 7.12.1 (#5017) Bump typescript from 4.0.3 to 4.0.5 (#5016) Bump lint-staged from 10.4.0 to 10.5.1 (#5014) Bump remark-cli from 8.0.1 to 9.0.0 (#4996) Bump jest-circus from 26.5.3 to 26.6.1 (#5009) Bump got from 11.7.0 to 11.8.0 (#5007) Bump jest from 26.5.3 to 26.6.1 (#5008) Refactor formatter tests (#4988) Fix `isStandardSyntaxDeclaration.test.js` that use callbacks (#4972) Update CHANGELOG.md Add "comment-pattern" rule (#4962) Update CHANGELOG.md Show the pattern in "*-pattern" rule messages (#4975) Enable ESLint `no-shadow` and add disable comments (#4986) Report disables in the same manner as lints (#4973) Update dependencies (#4982) Fix some tests that use callbacks (#4970) Use own vendor utility instead of PostCSS (#4942) (#4963) ...
This PR fixes the following tests that use callbacks:
lib/utils/__tests__/findAtRuleContext.test.js
lib/utils/__tests__/isContextFunctionalPseudoClass.test.js
lib/utils/__tests__/isMap.test.js
lib/utils/__tests__/isStandardSyntaxFunction.test.js
This is a part of #4881.
This PR includes some indentation changes, so I recommend viewing with hidden whitespace changes.