Comments (11)
I need to test this out. Right now, PHPCS is running CSSLint on all CSS files.
from wprig.
@mor10 cool! It is awesome that CSS code right now is protected.
BTW, even CSS Lint author think that Stylelint is better ;)
https://twitter.com/slicknet/status/1012002688622399488
from wprig.
Always looking for improvements. Want to make a PR to wire this in, or do you want to wait for my experimentation?
from wprig.
@mor10 Stylelint needs a config (the same was as in ESLint, there is no default config, you must select rule manually or to use some community shared config). So it will be better to decide what rules are important for you.
But I will send you a PR with a code to use Stylelint in Gulp:
from wprig.
Here is PR with initial support: #45
What could be added:
- Mention Stylelint in the docs.
- Add
stylelint-config-recommended-scss
and lint Sass files insass
Gulp task. But in this case, we need to separate origin CSS files and compiled from Sass CSS files (to not lint Sass files twice). - Stylelint could automatically fix some of the problems. Maybe we need to give a simple way to use this feature for users? Maybe
pre-commit
hook? - Review WordPress Stylelint config. Maybe add some other rules like keep persist order of properties?
from wprig.
I took a stab at this in #56.
Stylelint could automatically fix some of the problems. Maybe we need to give a simple way to use this feature for users? Maybe pre-commit hook?
gulp-stylelint
has an option to do fixes inline. I set it so it fixes what it can before writing the output CSS file. It might make more sense to update the source file rather than the destination though. Maybe this could be a new gulp task that can be added to scripts
in package.json
as npm run fix-styles
or similar.
Add stylelint-config-recommended-scss and lint Sass files in sass Gulp task. But in this case, we need to separate origin CSS files and compiled from Sass CSS files (to not lint Sass files twice).
This should be doable now that #47 is merged as sass files get written to the same destination as CSS files rather than the CSS dev directory.
from wprig.
Review WordPress Stylelint config. Maybe add some other rules like keep persist order of properties?
If we keep with the current WordPress rules there are quite a few violations in dev/style.css
(see the attached report).
wp-rig-stylelint-report-wordpress-coding-standards.txt
from wprig.
Merged with v1.1. Closing.
from wprig.
@mor10 what do you want to do about the existing coding standard violations in WP Rig? They are mostly in CSS
from wprig.
I thought they were fixed. If not, I'll get it sorted.
from wprig.
I believe all of this is now resolved. Closing.
from wprig.
Related Issues (20)
- theme.json HOT 1
- Can't extend any core classes HOT 2
- Integrate Theme.Json into WP-Rig HOT 2
- Bug blank page editor with 5.9 .. HOT 4
- Styles task hangs and never seems to complete HOT 1
- Inline SVG undefined properties HOT 1
- Change out colors to use block theme colors HOT 4
- Mobile menu obscures content when toggled off HOT 2
- Running production version changes part of string to 'undefined' HOT 3
- Update Deprecated Node Modules HOT 5
- Help instalation HOT 25
- PHP Fatal error on fresh install (`WP_Rig\WP_Rig\JavaScript\Component`) HOT 1
- Why is it so hard (read impossible) to change the color of the mobile menu toggle? HOT 1
- Upgrade Babel and eslint
- I installed but it stays in scripts HOT 3
- watch process freezes after "Finished 'editorStyles'.... " HOT 2
- mobile menu clickable under text when hamburger menu is folded up HOT 4
- Seemingly incomplete collapsible sub menu items feature in mobile nav
- Use intersection observer to swap the submenu direction so items do not go offscreen
- Version not updating when running production bundle due to mismatch in constants.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wprig.