From e7c6d865a460c349f231730b54428ee8dd49b021 Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Sun, 20 Oct 2024 02:14:37 +0200 Subject: [PATCH] Update dependencies --- .husky/pre-commit | 5 +- jest-setup.js | 2 +- lib/__tests__/test.js | 2 +- lib/getComments.js | 2 +- lib/order/__tests__/order.js | 20 +- .../__tests__/properties-order.js | 60 +- lib/validateOptions.js | 4 +- package-lock.json | 6390 +++++++++-------- package.json | 24 +- 9 files changed, 3533 insertions(+), 2976 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af219..c27d889 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx lint-staged +lint-staged diff --git a/jest-setup.js b/jest-setup.js index 7e9d879..d0855ff 100644 --- a/jest-setup.js +++ b/jest-setup.js @@ -19,7 +19,7 @@ global.groupTest = function groupTest(testGroups) { .process(item.fixture, { from: undefined }) .then((root) => { expect(root.css).toEqual(item.expected); - }) + }), ); }); }); diff --git a/lib/__tests__/test.js b/lib/__tests__/test.js index 13479df..6519cdb 100644 --- a/lib/__tests__/test.js +++ b/lib/__tests__/test.js @@ -12,6 +12,6 @@ test(`Should throw an error if config has error`, () => { }; return expect(postcss([plugin(opts)]).process('', { from: undefined })).rejects.toThrow( - 'postcss-sorting: order: Should be an array' + 'postcss-sorting: order: Should be an array', ); }); diff --git a/lib/getComments.js b/lib/getComments.js index 42c2c59..82dffff 100644 --- a/lib/getComments.js +++ b/lib/getComments.js @@ -103,6 +103,6 @@ function afterDeclaration(comments, nextNode, nodeData, currentInitialIndex) { [...comments, commentData], nextNode.next(), nodeData, - commentData.initialIndex + commentData.initialIndex, ); } diff --git a/lib/order/__tests__/order.js b/lib/order/__tests__/order.js index 92b3ccc..3c7a8a3 100644 --- a/lib/order/__tests__/order.js +++ b/lib/order/__tests__/order.js @@ -17,7 +17,7 @@ test('Should assign comments before and after nodes correctly (order)', () => { order: ['custom-properties', 'dollar-variables', 'at-variables', 'declarations'], }, - __dirname + __dirname, )); test('Should sort by keywords', () => @@ -33,7 +33,7 @@ test('Should sort by keywords', () => 'at-rules', ], }, - __dirname + __dirname, )); test('At-rules combination from most specified to least specified', () => @@ -70,7 +70,7 @@ test('At-rules combination from most specified to least specified', () => }, ], }, - __dirname + __dirname, )); test('At-rules mixed combination', () => @@ -104,7 +104,7 @@ test('At-rules mixed combination', () => }, ], }, - __dirname + __dirname, )); test('Should sort inside nested rules', () => @@ -113,7 +113,7 @@ test('Should sort inside nested rules', () => { order: ['custom-properties', 'declarations', 'rules'], }, - __dirname + __dirname, )); test('Should sort inside nested at-rules', () => @@ -122,7 +122,7 @@ test('Should sort inside nested at-rules', () => { order: ['custom-properties', 'declarations', 'at-rules'], }, - __dirname + __dirname, )); test('Should move unspecified nodes to the bottom', () => @@ -131,7 +131,7 @@ test('Should move unspecified nodes to the bottom', () => { order: ['custom-properties', 'declarations'], }, - __dirname + __dirname, )); test('Should preserve indentation', () => @@ -140,7 +140,7 @@ test('Should preserve indentation', () => { order: ['declarations', 'rules', 'at-rules'], }, - __dirname + __dirname, )); groupTest([ @@ -613,7 +613,7 @@ test('Should sort by keywords (styled)', () => { order: ['declarations', 'rules', 'at-rules'], }, - __dirname + __dirname, )); test('Ignore nodes with template literals (styled)', () => @@ -622,5 +622,5 @@ test('Ignore nodes with template literals (styled)', () => { order: ['declarations', 'rules', 'at-rules'], }, - __dirname + __dirname, )); diff --git a/lib/properties-order/__tests__/properties-order.js b/lib/properties-order/__tests__/properties-order.js index 754c6b5..9a7de6f 100644 --- a/lib/properties-order/__tests__/properties-order.js +++ b/lib/properties-order/__tests__/properties-order.js @@ -4,7 +4,7 @@ test('Should sort properties (array config)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Should sort prefixed properties before unprefixed property', () => @@ -13,7 +13,7 @@ test('Should sort prefixed properties before unprefixed property', () => { 'properties-order': ['position', '-webkit-box-sizing', 'box-sizing', 'width'], }, - __dirname + __dirname, )); test('Should assign comments before and after declarations correctly (properties-order)', () => @@ -22,7 +22,7 @@ test('Should assign comments before and after declarations correctly (properties { 'properties-order': ['border-bottom', 'font-style'], }, - __dirname + __dirname, )); test('Should place the leftovers properties in the end (not specified)', () => @@ -31,7 +31,7 @@ test('Should place the leftovers properties in the end (not specified)', () => { 'properties-order': ['position', 'z-index'], }, - __dirname + __dirname, )); test('Should place the leftovers properties in the end (bottom)', () => @@ -41,7 +41,7 @@ test('Should place the leftovers properties in the end (bottom)', () => 'properties-order': ['position', 'z-index'], 'unspecified-properties-position': 'bottom', }, - __dirname + __dirname, )); test('Should place the leftovers properties in the beginning (top)', () => @@ -51,7 +51,7 @@ test('Should place the leftovers properties in the beginning (top)', () => 'properties-order': ['position', 'z-index'], 'unspecified-properties-position': 'top', }, - __dirname + __dirname, )); test('Should place the leftovers properties in the end (bottomAlphabetical)', () => @@ -61,7 +61,7 @@ test('Should place the leftovers properties in the end (bottomAlphabetical)', () 'properties-order': ['position', 'z-index'], 'unspecified-properties-position': 'bottomAlphabetical', }, - __dirname + __dirname, )); test('Should preserve order if properties have same name', () => @@ -70,7 +70,7 @@ test('Should preserve order if properties have same name', () => { 'properties-order': ['position', 'z-index'], }, - __dirname + __dirname, )); test('Should preserve order if properties have same name', () => @@ -79,7 +79,7 @@ test('Should preserve order if properties have same name', () => { 'properties-order': ['position', 'z-index'], }, - __dirname + __dirname, )); test('Should preserve order if properties have same name', () => @@ -88,7 +88,7 @@ test('Should preserve order if properties have same name', () => { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test('Should preserve order if properties have same name (case insensitive)', () => @@ -97,7 +97,7 @@ test('Should preserve order if properties have same name (case insensitive)', () { 'properties-order': ['position', 'z-index'], }, - __dirname + __dirname, )); test('Should preserve order if properties have same name (case insensitive)', () => @@ -106,7 +106,7 @@ test('Should preserve order if properties have same name (case insensitive)', () { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test(`Should not remove first comment in the rule if it's not on separate line (properties-order)`, () => @@ -115,7 +115,7 @@ test(`Should not remove first comment in the rule if it's not on separate line ( { 'properties-order': ['display'], }, - __dirname + __dirname, )); test(`Should sort declarations grouped together between not declarations (without comments)`, () => @@ -124,7 +124,7 @@ test(`Should sort declarations grouped together between not declarations (withou { 'properties-order': ['display', 'position'], }, - __dirname + __dirname, )); test(`Should sort declarations grouped together between not declarations (with comments)`, () => @@ -133,7 +133,7 @@ test(`Should sort declarations grouped together between not declarations (with c { 'properties-order': ['display', 'position'], }, - __dirname + __dirname, )); test(`Should sort declarations scattered everywhere (without comments)`, () => @@ -142,7 +142,7 @@ test(`Should sort declarations scattered everywhere (without comments)`, () => { 'properties-order': ['display', 'position'], }, - __dirname + __dirname, )); test(`Should sort declarations scattered everywhere (with comments)`, () => @@ -151,7 +151,7 @@ test(`Should sort declarations scattered everywhere (with comments)`, () => { 'properties-order': ['display', 'position'], }, - __dirname + __dirname, )); test('Should sort properties alphabetically', () => @@ -160,7 +160,7 @@ test('Should sort properties alphabetically', () => { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test('Should sort properties alphabetically regardless of case', () => { @@ -169,7 +169,7 @@ test('Should sort properties alphabetically regardless of case', () => { { 'properties-order': 'alphabetical', }, - __dirname + __dirname, ); }); @@ -179,7 +179,7 @@ test('Should sort shorthand properties before their longhand versions', () => { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test('Should sort prefixed properties before unprefixed property in alphabetical order', () => @@ -188,7 +188,7 @@ test('Should sort prefixed properties before unprefixed property in alphabetical { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test('Should assign comments before and after declarations correctly (properties-order, alphabetical)', () => @@ -197,7 +197,7 @@ test('Should assign comments before and after declarations correctly (properties { 'properties-order': 'alphabetical', }, - __dirname + __dirname, )); test(`Preserve-empty-lines-between properties`, () => @@ -206,7 +206,7 @@ test(`Preserve-empty-lines-between properties`, () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Should sort properties (styled)', () => @@ -215,7 +215,7 @@ test('Should sort properties (styled)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Should sort properties in nested rules (styled)', () => @@ -224,7 +224,7 @@ test('Should sort properties in nested rules (styled)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Should sort properties in css helper (styled)', () => @@ -233,7 +233,7 @@ test('Should sort properties in css helper (styled)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Ignore template literals in flat components (styled)', () => @@ -242,7 +242,7 @@ test('Ignore template literals in flat components (styled)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Ignore template literals in nested components (styled)', () => @@ -251,7 +251,7 @@ test('Ignore template literals in nested components (styled)', () => { 'properties-order': ['position', 'top', 'display', 'z-index'], }, - __dirname + __dirname, )); test('Should sort properties (html,