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
Update scripts to point specifically to node_modules/.bin so that local standards are always prioritized.
Setup PHPCS ruleset
Update CSS Script to lint CSS & SCSS
Add PHP linting script
Install WDS dev dependency @webdevstudios/css-coding-standards
Install WDS dev dependency @webdevstudios/js-coding-standards
Setup a stylelint ignore section to prevent issues linting on unwanted directories
Remove .eslint file in favor of declaring extensions in package.json.
Update wepback config test loader to accept various file extensions beyond CSS. This is needed in cases where SCSS is preferred.
How to Test
Checkout this branch locally and verify your Global standards are disabled.
Run npm install then try running each script.
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.
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
eslint
Disable eslint config file.
sasslint
Disable sasslint config file.
Updates
node_modules/.bin
so that local standards are always prioritized..eslint
file in favor of declaring extensions inpackage.json
.How to Test
npm install
then try running each script.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 thecss.js
as well.