Problem/Motivation
Standard check and linting tools are outdated.
And a new linting tool with yarn lint:yaml was added to Drupal core
#2591827: Add YAML linting to core coding standards checks
Very important to make sure that all .yml files are in the right format.
eslint-plugin-yml a good tool to lint with
Example: using not standard format
or check on any duplicate yaml elements
Proposed resolution
Add the yarn lint:yaml
and update all outdated check configs and the package.json file
Compiling Provided Component Styles
In case of wanting to add a new feature or fix a bug in styling for a selected Varbase component.
Get Needed Yarn Development Dependencies
yarn install
Initialize
Initialize the gulp SASS files styling method. Run this only ones for each newly cloned project.
yarn theme:init
Theme Build
Compile source .scss files to .css files. Needs to compile manually on demand.
yarn theme:build
Watch
Watch source .scss files and compile them on saving to .css files. Auto compiling on save of changes for the source.
yarn theme:watchAfter any change of code please check the standards before uploading a patch or creating a MR.
Check Standards/Practice Coding And Linting
Check Drupal Standard And Practice Coding
Check Drupal standard and practice coding.
yarn phpcs
PHP Code Beautifier and Fixer
Fix many errors and warnings automatically.
yarn phpcbf
Linting YAML files
Check all .yml files with Drupal standard yaml format.
yarn lint:yaml
Linting JavaScript files
Check all JavaScript .js, .json files with Drupal standard scripting format.
yarn lint:js
Linting Styling
Check all styling .css files with Drupal standard styling format and order.
yarn lint:css
"scripts": { "theme:init": "gulp", "theme:build": "gulp compile", "theme:watch": "gulp watch", "phpcs": "phpcs --standard=./.phpcs.xml .", "phpcbf": "phpcbf --standard=./.phpcs.xml .", "lint:yaml": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .yml .", "lint:js": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json .", "lint:css": "npx stylelint --config=.stylelintrc.json ." },
Remaining tasks
- ✅ File an issue about this project
- ✅ Add
lint:yamland update packages inpackage.json - ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ✅ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Release varbase-9.0.2, varbase_layout_builder-10.0.4
User interface changes
- None
API changes
- None
Data model changes
- None
Comments
Comment #2
rajab natshahComment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
rajab natshah✅ Developer Documentation support on feature change/addition
Varbase documentation
Install Needed YARN and Gulp Tools
Compiling Provided Component Styles
Check Standards/Practice Coding And Linting
Comment #8
rajab natshahComment #9
rajab natshahComment #10
rajab natshahComment #11
rajab natshahComment #12
rajab natshahComment #13
rajab natshahComment #15
rajab natshahComment #16
rajab natshahComment #17
rajab natshahComment #18
rajab natshahComment #19
rajab natshahComment #21
rajab natshahComment #22
rajab natshahComment #23
rajab natshah