Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hudochenkov committed Oct 20, 2024
1 parent b304239 commit e7c6d86
Show file tree
Hide file tree
Showing 9 changed files with 3,533 additions and 2,976 deletions.
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
lint-staged
2 changes: 1 addition & 1 deletion jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ global.groupTest = function groupTest(testGroups) {
.process(item.fixture, { from: undefined })
.then((root) => {
expect(root.css).toEqual(item.expected);
})
}),
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});
2 changes: 1 addition & 1 deletion lib/getComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ function afterDeclaration(comments, nextNode, nodeData, currentInitialIndex) {
[...comments, commentData],
nextNode.next(),
nodeData,
commentData.initialIndex
commentData.initialIndex,
);
}
20 changes: 10 additions & 10 deletions lib/order/__tests__/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () =>
Expand All @@ -33,7 +33,7 @@ test('Should sort by keywords', () =>
'at-rules',
],
},
__dirname
__dirname,
));

test('At-rules combination from most specified to least specified', () =>
Expand Down Expand Up @@ -70,7 +70,7 @@ test('At-rules combination from most specified to least specified', () =>
},
],
},
__dirname
__dirname,
));

test('At-rules mixed combination', () =>
Expand Down Expand Up @@ -104,7 +104,7 @@ test('At-rules mixed combination', () =>
},
],
},
__dirname
__dirname,
));

test('Should sort inside nested rules', () =>
Expand All @@ -113,7 +113,7 @@ test('Should sort inside nested rules', () =>
{
order: ['custom-properties', 'declarations', 'rules'],
},
__dirname
__dirname,
));

test('Should sort inside nested at-rules', () =>
Expand All @@ -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', () =>
Expand All @@ -131,7 +131,7 @@ test('Should move unspecified nodes to the bottom', () =>
{
order: ['custom-properties', 'declarations'],
},
__dirname
__dirname,
));

test('Should preserve indentation', () =>
Expand All @@ -140,7 +140,7 @@ test('Should preserve indentation', () =>
{
order: ['declarations', 'rules', 'at-rules'],
},
__dirname
__dirname,
));

groupTest([
Expand Down Expand Up @@ -613,7 +613,7 @@ test('Should sort by keywords (styled)', () =>
{
order: ['declarations', 'rules', 'at-rules'],
},
__dirname
__dirname,
));

test('Ignore nodes with template literals (styled)', () =>
Expand All @@ -622,5 +622,5 @@ test('Ignore nodes with template literals (styled)', () =>
{
order: ['declarations', 'rules', 'at-rules'],
},
__dirname
__dirname,
));
60 changes: 30 additions & 30 deletions lib/properties-order/__tests__/properties-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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', () =>
Expand All @@ -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', () =>
Expand All @@ -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', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)`, () =>
Expand All @@ -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)`, () =>
Expand All @@ -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)`, () =>
Expand All @@ -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)`, () =>
Expand All @@ -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)`, () =>
Expand All @@ -151,7 +151,7 @@ test(`Should sort declarations scattered everywhere (with comments)`, () =>
{
'properties-order': ['display', 'position'],
},
__dirname
__dirname,
));

test('Should sort properties alphabetically', () =>
Expand All @@ -160,7 +160,7 @@ test('Should sort properties alphabetically', () =>
{
'properties-order': 'alphabetical',
},
__dirname
__dirname,
));

test('Should sort properties alphabetically regardless of case', () => {
Expand All @@ -169,7 +169,7 @@ test('Should sort properties alphabetically regardless of case', () => {
{
'properties-order': 'alphabetical',
},
__dirname
__dirname,
);
});

Expand All @@ -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', () =>
Expand All @@ -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)', () =>
Expand All @@ -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`, () =>
Expand All @@ -206,7 +206,7 @@ test(`Preserve-empty-lines-between properties`, () =>
{
'properties-order': ['position', 'top', 'display', 'z-index'],
},
__dirname
__dirname,
));

test('Should sort properties (styled)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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)', () =>
Expand All @@ -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, <style> tag)', () =>
Expand All @@ -260,7 +260,7 @@ test('Should sort properties (html, <style> tag)', () =>
{
'properties-order': ['position', 'top', 'display', 'z-index'],
},
__dirname
__dirname,
));

test('Should sort properties (html, style attribute)', () =>
Expand All @@ -269,5 +269,5 @@ test('Should sort properties (html, style attribute)', () =>
{
'properties-order': ['position', 'top', 'display', 'z-index'],
},
__dirname
__dirname,
));
Loading

0 comments on commit e7c6d86

Please sign in to comment.