WebDevStudios / wds-block-starter

A block starter for projects.
15 stars 3 forks source link

Feature/linting #3

Closed michealengland closed 4 years ago

michealengland commented 4 years ago

Linting Update

This PR contains linting updates for PHP, JS, CSS, and SCSS. Additional steps may be needed for linter use in this plugin. Huge props to @aubreypwd for help getting this up and running.

While working on this I had to disable the following in VS Code to ensure that local standards are being utilized instead of Global standards.

PHPCS

Disable PHPCS settings that point to WDS global settings

"phpcs.standard": "WebDevStudios",
"phpcs.executablePath": "/Users/mikeengland/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs",

eslint

Disable eslint config file.

"configFile": "/Users/mikeengland/.composer/vendor/webdevstudios/wds-coding-standards/WebDevStudios/eslint-plugin-webdevstudios/index.js",

sasslint

Disable sasslint config file.

"sasslint.configFile": "/Users/mikeengland/.composer/vendor/webdevstudios/wds-coding-standards/WebDevStudios/sass-lint.yml",

Updates

How to Test

  1. Checkout this branch locally and verify your Global standards are disabled.
  2. Run npm install then try running each script.
  3. Verify that your lint in CLI matches your code editor linter does. ( In VS Code this should appear in the problems panel ).

Note: When linting CSS, you may need to change file extensions in src/block/rich-text to .scss. This will enable the WDS linter to lint this code as SCSS instead of CSS. Don't for get to update the css.js as well.