-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add initial support for long comments in headers of WordPress th…
…eme `style.css` files. (#151) This change allows for longer comments in themes header: • URLs longer than 80 characters • Descriptions longer than 80 characters • Tags longer than 80 characters Fixes #150.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/stylelint-config-wordpress/__tests__/themes-valid.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
Theme Name: Twenty Ten | ||
Theme URI: https://wordpress.org/themes/twentyten/themes/twentyten/themes/twentyten/themes/twentyten/ | ||
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar. | ||
Author: the WordPress team | ||
Author URI: https://wordpress.org/ | ||
Version: 2.3 | ||
License: GNU General Public License v2 or later | ||
License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
Tags: blog, two-columns, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu, flexible-header, featured-images, footer-widgets, featured-image-header | ||
Text Domain: twentyten | ||
*/ | ||
|
||
a { | ||
top: 0.2em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const fs = require( 'fs' ), | ||
config = require( '../' ), | ||
stylelint = require( 'stylelint' ), | ||
validCss = fs.readFileSync( './__tests__/themes-valid.css', 'utf-8' ); | ||
|
||
describe( 'flags no warnings with valid css', () => { | ||
let result; | ||
|
||
beforeEach( () => { | ||
result = stylelint.lint({ | ||
code: validCss, | ||
config, | ||
}); | ||
}); | ||
|
||
it( 'did not error', () => { | ||
return result.then( data => ( | ||
expect( data.errored ).toBeFalsy() | ||
) ); | ||
}); | ||
|
||
it( 'flags no warnings', () => { | ||
return result.then( data => ( | ||
expect( data.results[0].warnings.length ).toBe( 0 ) | ||
) ); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters