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

Ignore the wordpress directory in stylelint. #16243

Merged
merged 1 commit into from Aug 20, 2019

Conversation

@desaiuditd
Copy link
Member

commented Jun 22, 2019

Description

While working in localwpdev mode in local environment, npm run lint-css does not ignore wordpress directory which works as a volume for the docker containers.

It throws errors as below:

[2] wordpress/wp-content/themes/twentynineteen/sass/site/primary/_comments.scss
[2]   87:25  ✖  Unexpected whitespace before ")"   function-parentheses-space-inside
[2]  174:22  ✖  Expected a leading zero            number-leading-zero
[2]  174:68  ✖  Unexpected whitespace before ")"   function-parentheses-space-inside
[2]  229:24  ✖  Unexpected whitespace after "("    function-parentheses-space-inside
[2]  229:41  ✖  Unexpected whitespace before ")"   function-parentheses-space-inside
[2]  235:48  ✖  Expected a leading zero            number-leading-zero
[2]  242:11  ✖  Unexpected named color "white"     color-named
[2]  369:21  ✖  Unexpected whitespace after "("    function-parentheses-space-inside
[2]  369:25  ✖  Unexpected whitespace before ")"   function-parentheses-space-inside
[2]  370:20  ✖  Expected a leading zero            number-leading-zero
[2]
[2] wordpress/wp-content/themes/twentynineteen/sass/site/primary/_posts-and-pages.scss
[2]   11:11  ✖  Expected a leading zero                         number-leading-zero
[2]  144:6   ✖  Expected double colon pseudo-element notation   selector-pseudo-element-colon-notation
[2]  149:15  ✖  Expected a leading zero                         number-leading-zero
[2]  162:5   ✖  Expected double colon pseudo-element notation   selector-pseudo-element-colon-notation
[2]  163:5   ✖  Expected double colon pseudo-element notation   selector-pseudo-element-colon-notation
[2]  168:12  ✖  Expected newline after ";"                      declaration-block-semicolon-newline-after
[2]  201:5   ✖  Expected double colon pseudo-element notation   selector-pseudo-element-colon-notation
[2]
[2] npm
[2]  ERR! code ELIFECYCLE
[2] npm
[2]  ERR! errno 2
[2] npm
[2]  ERR! gutenberg@5.9.2 lint-css: `wp-scripts lint-style '**/*.scss'`
[2] npm ERR! Exit status 2
[2] npm ERR!
[2] npm ERR! Failed at the gutenberg@5.9.2 lint-css script.
[2] npm ERR!
[2]  This is probably not a problem with npm. There is likely additional logging output above.
[2]
[2] npm ERR! A complete log of this run can be found in:
[2] npm ERR!     /Users/udit.desai/.npm/_logs/2019-06-22T07_11_57_444Z-debug.log
[2] npm run lint-css exited with code 2

wordpress directory should not be scanned and ignored for the linting purpose.

How has this been tested?

  • Running npm run lint-css in local environment does not report those errors anymore.
  • Local Environment: MacOS
  • This is only affected in linting the source code. No behavior change is expected.

Screenshots

Screen Shot 2019-06-22 at 17 21 14

Types of changes

  • Introduced .stylelintignore file at the project root and added wordpress directory in it to ignore.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
@pento
pento approved these changes Aug 20, 2019
Copy link
Member

left a comment

I ran into the same problem working on #17004! Let's merge this PR, I can rebase mine.

@pento pento changed the title Ignore wordpress directory in style lint while working in localwpdev mode Ignore the wordpress directory in stylelint. Aug 20, 2019
@pento pento merged commit 37d7dce into WordPress:master Aug 20, 2019
1 of 4 checks passed
1 of 4 checks passed
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Travis CI - Pull Request Build Passed
Details
pento added a commit that referenced this pull request Aug 20, 2019
@desaiuditd desaiuditd deleted the desaiuditd:fix/ignore-wordpress-directory-in-style-linting branch Aug 20, 2019
pento added a commit that referenced this pull request Aug 22, 2019
pento added a commit that referenced this pull request Aug 22, 2019
pento added a commit that referenced this pull request Aug 27, 2019
pento added a commit that referenced this pull request Aug 29, 2019
@gziolo

This comment has been minimized.

Copy link
Member

commented Sep 2, 2019

Related: #17296 which will enable it for all plugin developers as well.

dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.