diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 91512ca..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "jest": true, - "node": true - }, - "extends": [ - "plugin:wordpress/recommended", - "plugin:jest/recommended" - ], - "parserOptions": { - "sourceType": "module" - }, - "plugins": [ - "jest" - ] -} diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..a745d74 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +*-invalid.* diff --git a/.travis.yml b/.travis.yml index a0a5294..65656b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ cache: - node_modules node_js: - - '8' - '10' + - '12' before_install: - npm install -g npm@latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d84c4c..8ee33f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# HEAD + +- Updated: `stylelint-find-rules` to `2.2.0`. + +# 15.0.0 + +- Added: NodeJS 12.x.x support. +- Updated: `stylelint` to `11.0.0`. +- Removed: `stylelint < 10.1.0` compatibility. +- Updated: `stylelint-config-recommended` to `3.0.0`. +- Updated: `stylelint-config-recommended-scss` to `4.0.0`. +- Updated: Bump minimum Node.js required version to `10.0.0`. + # 14.0.0 - Updated: `stylelint` to `10.0.0`. diff --git a/__tests__/__snapshots__/scss.test.js.snap b/__tests__/__snapshots__/scss.test.js.snap deleted file mode 100644 index 57dbe6b..0000000 --- a/__tests__/__snapshots__/scss.test.js.snap +++ /dev/null @@ -1,62 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`flags warnings with invalid scss snapshot matches warnings 1`] = ` -Array [ - Object { - "column": 1, - "line": 1, - "rule": "scss/at-rule-no-unknown", - "severity": "error", - "text": "Unexpected unknown at-rule \\"@unknown\\" (at-rule-no-unknown) (scss/at-rule-no-unknown)", - }, - Object { - "column": 2, - "line": 12, - "rule": "scss/at-if-closing-brace-space-after", - "severity": "error", - "text": "Expected single space after \\"}\\" of @if statement (scss/at-if-closing-brace-space-after)", - }, - Object { - "column": 1, - "line": 14, - "rule": "scss/at-else-empty-line-before", - "severity": "error", - "text": "Unexpected empty line before @else (scss/at-else-empty-line-before)", - }, - Object { - "column": 2, - "line": 12, - "rule": "scss/at-if-closing-brace-newline-after", - "severity": "error", - "text": "Unexpected newline after \\"}\\" of @if statement (scss/at-if-closing-brace-newline-after)", - }, - Object { - "column": 2, - "line": 22, - "rule": "at-rule-empty-line-before", - "severity": "error", - "text": "Unexpected empty line before at-rule (at-rule-empty-line-before)", - }, - Object { - "column": 5, - "line": 14, - "rule": "block-opening-brace-space-before", - "severity": "error", - "text": "Expected single space before \\"{\\" (block-opening-brace-space-before)", - }, - Object { - "column": 15, - "line": 28, - "rule": "no-extra-semicolons", - "severity": "error", - "text": "Unexpected extra semicolon (no-extra-semicolons)", - }, - Object { - "column": 7, - "line": 31, - "rule": "number-leading-zero", - "severity": "error", - "text": "Expected a leading zero (number-leading-zero)", - }, -] -`; diff --git a/__tests__/commenting.test.js b/__tests__/commenting.test.js index 3895ee1..5ee417e 100644 --- a/__tests__/commenting.test.js +++ b/__tests__/commenting.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid commenting css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid commenting css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 3 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 3 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/functions.test.js b/__tests__/functions.test.js index 6c4cf6a..5a10154 100644 --- a/__tests__/functions.test.js +++ b/__tests__/functions.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid functions css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid functions css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 1 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 1 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/index.test.js b/__tests__/index.test.js index 920af97..800ca2f 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 1 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 1 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/media-queries.test.js b/__tests__/media-queries.test.js index 3f9d1b2..c0bd481 100644 --- a/__tests__/media-queries.test.js +++ b/__tests__/media-queries.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid media queries css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid media queries css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 11 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 11 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/properties.test.js b/__tests__/properties.test.js index dc56732..c939e50 100644 --- a/__tests__/properties.test.js +++ b/__tests__/properties.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid properties css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid properties css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 7 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 7 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/scss.test.js b/__tests__/scss.test.js index 66719ea..92487b5 100644 --- a/__tests__/scss.test.js +++ b/__tests__/scss.test.js @@ -10,50 +10,53 @@ describe( 'flags no warnings with valid scss', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validScss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid scss', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidScss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 8 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 8 ) ) ); - }); + } ); + /** + * ToDo: Fix snapshot, as results differ between Node.js v10 & v12 it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); + */ +} ); diff --git a/__tests__/selectors-scss.test.js b/__tests__/selectors-scss.test.js index 8bd3b9e..b83a11b 100644 --- a/__tests__/selectors-scss.test.js +++ b/__tests__/selectors-scss.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid selectors scss', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validScss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid selectors scss', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidScss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 6 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 6 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/selectors.test.js b/__tests__/selectors.test.js index 817e835..55ead86 100644 --- a/__tests__/selectors.test.js +++ b/__tests__/selectors.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid selectors css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid selectors css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 4 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 4 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/structure.test.js b/__tests__/structure.test.js index de723e0..2bddd22 100644 --- a/__tests__/structure.test.js +++ b/__tests__/structure.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid structure css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid structure css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 8 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 8 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/themes.test.js b/__tests__/themes.test.js index 9adfab7..d8e0e3a 100644 --- a/__tests__/themes.test.js +++ b/__tests__/themes.test.js @@ -9,21 +9,21 @@ describe( 'flags no warnings with valid css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); diff --git a/__tests__/values.test.js b/__tests__/values.test.js index b43eff6..a25742f 100644 --- a/__tests__/values.test.js +++ b/__tests__/values.test.js @@ -10,50 +10,50 @@ describe( 'flags no warnings with valid values css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); describe( 'flags warnings with invalid values css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: invalidCss, config, - }); - }); + } ); + } ); it( 'did error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeTruthy() ) ); - }); + } ); it( 'flags correct number of warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 9 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 9 ) ) ); - }); + } ); it( 'snapshot matches warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toMatchSnapshot() + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toMatchSnapshot() ) ); - }); -}); + } ); +} ); diff --git a/__tests__/vendor-prefixes.test.js b/__tests__/vendor-prefixes.test.js index 8090fff..011d0af 100644 --- a/__tests__/vendor-prefixes.test.js +++ b/__tests__/vendor-prefixes.test.js @@ -9,21 +9,21 @@ describe( 'flags no warnings with valid vendor prefixes css', () => { let result; beforeEach( () => { - result = stylelint.lint({ + result = stylelint.lint( { code: validCss, config, - }); - }); + } ); + } ); it( 'did not error', () => { - return result.then( data => ( + return result.then( ( data ) => ( expect( data.errored ).toBeFalsy() ) ); - }); + } ); it( 'flags no warnings', () => { - return result.then( data => ( - expect( data.results[0].warnings ).toHaveLength( 0 ) + return result.then( ( data ) => ( + expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ) ); - }); -}); + } ); +} ); diff --git a/appveyor.yml b/appveyor.yml index 43ecc40..a877d1b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,8 @@ environment: matrix: - - nodejs_version: 8 - nodejs_version: 10 + - nodejs_version: 12 version: "{build}" build: off diff --git a/index.js b/index.js index c726e02..072a7dc 100644 --- a/index.js +++ b/index.js @@ -4,8 +4,8 @@ module.exports = { extends: 'stylelint-config-recommended', rules: { 'at-rule-empty-line-before': [ 'always', { - except: ['blockless-after-blockless'], - ignore: ['after-comment'], + except: [ 'blockless-after-blockless' ], + ignore: [ 'after-comment' ], } ], 'at-rule-name-case': 'lower', 'at-rule-name-space-after': 'always-single-line', @@ -19,12 +19,12 @@ module.exports = { 'color-hex-length': 'short', 'color-named': 'never', 'comment-empty-line-before': [ 'always', { - ignore: ['stylelint-commands'], + ignore: [ 'stylelint-commands' ], } ], 'declaration-bang-space-after': 'never', 'declaration-bang-space-before': 'always', 'declaration-block-no-duplicate-properties': [ true, { - ignore: ['consecutive-duplicates'], + ignore: [ 'consecutive-duplicates' ], } ], 'declaration-block-semicolon-newline-after': 'always', 'declaration-block-semicolon-space-before': 'never', @@ -33,17 +33,17 @@ module.exports = { 'declaration-colon-space-after': 'always-single-line', 'declaration-colon-space-before': 'never', 'declaration-property-unit-whitelist': { - 'line-height': ['px'], + 'line-height': [ 'px' ], }, 'font-family-name-quotes': 'always-where-recommended', 'font-weight-notation': [ 'numeric', { - ignore: ['relative'], + ignore: [ 'relative' ], } ], 'function-comma-space-after': 'always', 'function-comma-space-before': 'never', 'function-max-empty-lines': 1, 'function-name-case': [ 'lower', { - ignoreFunctions: ['/^DXImageTransform.Microsoft.*$/'], + ignoreFunctions: [ '/^DXImageTransform.Microsoft.*$/' ], } ], 'function-parentheses-space-inside': 'never', 'function-url-quotes': 'never', @@ -53,7 +53,7 @@ module.exports = { 'max-empty-lines': 2, 'max-line-length': [ 80, { ignore: 'non-comments', - ignorePattern: ['/(https?://[0-9,a-z]*.*)|(^description\\:.+)|(^tags\\:.+)/i'], + ignorePattern: [ '/(https?://[0-9,a-z]*.*)|(^description\\:.+)|(^tags\\:.+)/i' ], } ], 'media-feature-colon-space-after': 'always', 'media-feature-colon-space-before': 'never', @@ -68,7 +68,7 @@ module.exports = { 'number-no-trailing-zeros': true, 'property-case': 'lower', 'rule-empty-line-before': [ 'always', { - ignore: ['after-comment'], + ignore: [ 'after-comment' ], } ], 'selector-attribute-brackets-space-inside': 'never', 'selector-attribute-operator-space-after': 'never', diff --git a/package.json b/package.json index 22f176a..de5cfc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-wordpress", - "version": "14.0.0", + "version": "15.0.0", "description": "WordPress shareable config for stylelint", "author": "stylelint", "license": "MIT", @@ -36,42 +36,40 @@ ], "main": "index.js", "dependencies": { - "stylelint-config-recommended": "^2.2.0", - "stylelint-config-recommended-scss": "^3.3.0", - "stylelint-scss": "^3.9.3" + "stylelint-config-recommended": "^3.0.0", + "stylelint-config-recommended-scss": "^4.0.0", + "stylelint-scss": "^3.11.1" }, "devDependencies": { - "@commitlint/cli": "^8.1.0", - "@commitlint/config-conventional": "^8.1.0", - "@wordpress/npm-package-json-lint-config": "^2.1.0", - "eslint": "^5.16.0", - "eslint-plugin-jest": "^22.4.1", - "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#b65ae0cea1199c9714641ed3be7ea98fcb27dd6c", - "husky": "^3.0.3", - "jest": "^24.7.1", - "npm-package-json-lint": "^3.7.0", + "@commitlint/cli": "^8.2.0", + "@commitlint/config-conventional": "^8.2.0", + "@wordpress/scripts": "^5.0.0", + "husky": "^3.0.8", "npm-run-all": "^4.1.5", - "npmpub": "^4.1.0", + "npmpub": "^5.0.0", "remark-cli": "^7.0.0", "remark-preset-lint-consistent": "^2.0.3", "remark-preset-lint-recommended": "^3.0.3", - "stylelint": "^10.1.0", - "stylelint-find-rules": "^2.1.0" + "stylelint": "^11.0.0", + "stylelint-find-rules": "^2.2.0" }, "peerDependencies": { - "stylelint": "^9.5.0 || ^10.1.0" + "stylelint": "^10.1.0 || ^11.0.0" }, "scripts": { + "check-engines": "wp-scripts check-engines --package", + "check-licenses": "wp-scripts check-licenses --production", "dry-release": "npmpub --dry --verbose", - "jest": "jest", - "lint:js": "eslint . --ignore-path .gitignore", + "lint:css": "wp-scripts lint-style", + "lint:js": "wp-scripts lint-js", "lint:md": "remark . --quiet --frail", - "lint:pkg-json": "npmPkgJsonLint .", + "lint:pkg-json": "wp-scripts lint-pkg-json", "lint": "npm-run-all --parallel lint:*", "pretest": "npm run lint", "release": "npmpub --verbose", "stylelint-find-unused-rules": "stylelint-find-rules --config index.js", - "test": "jest", + "test:unit": "wp-scripts test-unit-js", + "test": "npm run test:unit", "watch": "jest --watch" }, "commitlint": { @@ -79,21 +77,17 @@ "@commitlint/config-conventional" ] }, + "eslintConfig": { + "root": true, + "extends": [ + "plugin:@wordpress/eslint-plugin/recommended" + ] + }, "husky": { "hooks": { "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS" } }, - "jest": { - "roots": [ - "__tests__" - ], - "testEnvironment": "node", - "testMatch": [ - "**/?(*.)(spec|test).js" - ], - "verbose": true - }, "npmPackageJsonLintConfig": { "extends": "@wordpress/npm-package-json-lint-config", "rules": { diff --git a/scss.js b/scss.js index 4f9e007..a85a129 100644 --- a/scss.js +++ b/scss.js @@ -14,9 +14,9 @@ module.exports = { // stylelint-config-wordpress css overrides 'at-rule-empty-line-before': [ 'always', { - except: ['blockless-after-blockless'], - ignore: ['after-comment'], - ignoreAtRules: ['else'], + except: [ 'blockless-after-blockless' ], + ignore: [ 'after-comment' ], + ignoreAtRules: [ 'else' ], } ], 'block-opening-brace-space-before': 'always',