Skip to:
Content

Opened 20 months ago

Closed 20 months ago

Last modified 7 months ago

#2924 closed defect (fixed)

Add stylelint for linting CSS to adhere to WordPress CSS Coding Standards

Reported by: netweb Owned by: netweb
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Tools - Build Keywords:
Cc:

Description

http://stylelint.io/

"Enforce consistent conventions and avoid errors in your stylesheets with stylelint, a modern CSS linter. "


https://github.com/ntwb/stylelint-config-wordpress

"WordPress CSS Coding Standards shareable config for stylelint "


https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/

Change History (9)

#1 @netweb
20 months ago

  • Owner set to netweb
  • Resolution set to fixed
  • Status changed from new to closed

In 5995:

Build Tools: Add @stylelint for linting CSS to adhere to WordPress CSS Coding Standards

This changeset adds a new Grunt task grunt postcss:lint that runs stylelint on CSS & SCSS files to ensure bbPress' CSS adheres to WordPress CSS Coding Standards.

8 months in the making and is maintained by yours truly @netweb, with stylelint I'm learning JavaScript deeply.

See also:

Hat-tip: David Clark and Richard Hallows for the ongoing help and support.

Props netweb.
Fixes #2924.

Last edited 20 months ago by netweb (previous) (diff)

#2 @netweb
20 months ago

Adding a comment as the commit message above isn't playing nice!

https://bbpress.trac.wordpress.org/changeset/5995

Last edited 20 months ago by netweb (previous) (diff)

#3 @netweb
20 months ago

In 5996:

Build Tools: Add NPM package postcss-scss for styelelint SCSS compatibility

This changeset fixes an idiosyncratic NPM v3.x issue with "flat" folders and sharing dependencies that is not an issue when using NPM v2

See #2924

#4 @netweb
20 months ago

In 5998:

Build Tools: Update styelelint to 5.3.0

See #2924

#5 @netweb
18 months ago

In 6028:

Build Tools: Update stylelint to 6.4.2

See #2924

#6 @netweb
18 months ago

In 6035:

Build Tools: Update stylelint to v6.5.1 and bump .stylelintrc to stylelint-config-wordpress v7.1.1

See #2924

#7 @netweb
14 months ago

In 6100:

Build Tools: Switch stylelint Grunt task from grunt postcss:lint to grunt stylelint

This changeset switches the stylelint task from using the grunt-postcss to grunt-stylelint NPM module. This new Grunt module supports stylelint's native formatters and allows for improved task error reporting. This change also splits the CSS and SCSS lint tasks in preparation for a future stylelint-config-wordpress SCSS update.

See also: https://github.com/wikimedia/grunt-stylelint

Props netweb.
See #2924.

#8 @netweb
7 months ago

In 6403:

Build Tools: Update stylelint

  • Update stylelint to v7.10.1
  • Update grunt-stylelint to v0.7.0
  • Switch from .stylelintrc format to stylelint shared config stylelint-config-wordpress
  • Add SCSS linting support that's now included in stylelint-config-wordpress

See #2924.

#9 @netweb
7 months ago

In 6404:

Build Tools: Fix copy pasta of ; instead of , added in [6403].

WordPress Coding Standards requires one variable declaration.

See #2924.

Note: See TracTickets for help on using tickets.