Skip to content

Commit fe827dd

Browse files
committed
Migrate to PostCSS 8
1 parent 3d92eea commit fe827dd

File tree

4 files changed

+68
-26
lines changed

4 files changed

+68
-26
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Lint and autofix style sheets order with [stylelint-order].
1919
## Installation
2020

2121
```bash
22-
$ npm install postcss-sorting
22+
$ npm install --save-dev postcss postcss-sorting
2323
```
2424

2525
## Options

index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
const postcss = require('postcss');
21
const _ = require('lodash');
32

43
const order = require('./lib/order');
54
const propertiesOrder = require('./lib/properties-order');
65
const validateOptions = require('./lib/validateOptions');
76

8-
module.exports = postcss.plugin('postcss-sorting', (opts) => {
9-
return (css) => {
10-
plugin(css, opts);
7+
module.exports = (opts) => {
8+
return {
9+
postcssPlugin: 'postcss-sorting',
10+
Root(css) {
11+
plugin(css, opts);
12+
},
1113
};
12-
});
14+
};
15+
16+
module.exports.postcss = true;
1317

1418
function plugin(css, opts) {
1519
const validatedOptions = validateOptions(opts);

package-lock.json

Lines changed: 53 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
"!.DS_Store"
2424
],
2525
"dependencies": {
26-
"lodash": "^4.17.20",
27-
"postcss": "^7.0.27"
26+
"lodash": "^4.17.20"
27+
},
28+
"peerDependencies": {
29+
"postcss": "^8.0.4"
2830
},
2931
"devDependencies": {
3032
"eslint": "^7.9.0",
@@ -36,6 +38,7 @@
3638
"jest": "^26.4.2",
3739
"jest-watch-typeahead": "^0.6.1",
3840
"lint-staged": "^10.4.0",
41+
"postcss": "^8.0.4",
3942
"postcss-html": "^0.36.0",
4043
"postcss-jsx": "^0.36.4",
4144
"postcss-syntax": "^0.36.2",

0 commit comments

Comments
 (0)