Code Monkey home page Code Monkey logo

Comments (11)

mor10 avatar mor10 commented on May 17, 2024

I need to test this out. Right now, PHPCS is running CSSLint on all CSS files.

from wprig.

ai avatar ai commented on May 17, 2024

@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.

mor10 avatar mor10 commented on May 17, 2024

Always looking for improvements. Want to make a PR to wire this in, or do you want to wait for my experimentation?

from wprig.

ai avatar ai commented on May 17, 2024

@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.

ai avatar ai commented on May 17, 2024

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 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).
  • 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.

ataylorme avatar ataylorme commented on May 17, 2024

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.

ataylorme avatar ataylorme commented on May 17, 2024

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.

mor10 avatar mor10 commented on May 17, 2024

Merged with v1.1. Closing.

from wprig.

ataylorme avatar ataylorme commented on May 17, 2024

@mor10 what do you want to do about the existing coding standard violations in WP Rig? They are mostly in CSS

from wprig.

mor10 avatar mor10 commented on May 17, 2024

I thought they were fixed. If not, I'll get it sorted.

from wprig.

mor10 avatar mor10 commented on May 17, 2024

I believe all of this is now resolved. Closing.

from wprig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.