postcss-discard-empty
Advanced tools
Comparing version 2.1.0 to 4.0.0-rc.0
@@ -0,1 +1,6 @@ | ||
# 4.0.0-rc.0 | ||
* Breaking: Drops support for Node 0.12, we now require at least Node 4. | ||
* Breaking: Update PostCSS to 6.0.0. | ||
# 2.1.0 | ||
@@ -2,0 +7,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _postcss = require('postcss'); | ||
var _postcss2 = _interopRequireDefault(_postcss); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var plugin = 'postcss-discard-empty'; | ||
function discardAndReport(css, result) { | ||
function discardEmpty(node) { | ||
var type = node.type; | ||
var sub = node.nodes; | ||
var type = node.type, | ||
sub = node.nodes, | ||
params = node.params; | ||
@@ -17,3 +26,3 @@ | ||
if (type === 'decl' && !node.value || type === 'rule' && !node.selector || sub && !sub.length || type === 'atrule' && (!sub && !node.params || !node.params && !sub.length)) { | ||
if (type === 'decl' && !node.value || type === 'rule' && !node.selector || sub && !sub.length || type === 'atrule' && (!sub && !params || !params && !sub.length)) { | ||
node.remove(); | ||
@@ -23,4 +32,4 @@ | ||
type: 'removal', | ||
plugin: 'postcss-discard-empty', | ||
node: node | ||
plugin, | ||
node | ||
}); | ||
@@ -33,7 +42,5 @@ } | ||
exports.default = (0, _postcss.plugin)('postcss-discard-empty', function () { | ||
return function (css, result) { | ||
return discardAndReport(css, result); | ||
}; | ||
exports.default = _postcss2.default.plugin(plugin, function () { | ||
return discardAndReport; | ||
}); | ||
module.exports = exports['default']; |
{ | ||
"name": "postcss-discard-empty", | ||
"version": "2.1.0", | ||
"version": "4.0.0-rc.0", | ||
"description": "Discard empty rules and values with PostCSS.", | ||
@@ -11,5 +11,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"pretest": "eslint src", | ||
"prepublish": "del-cli dist && babel src --out-dir dist --ignore /__tests__/", | ||
"test": "ava src/__tests__" | ||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/" | ||
}, | ||
@@ -27,17 +25,9 @@ "keywords": [ | ||
"dependencies": { | ||
"postcss": "^5.0.14" | ||
"postcss": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.14.0", | ||
"babel-cli": "^6.4.5", | ||
"babel-core": "^6.4.5", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-es2015-loose": "^7.0.0", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"del-cli": "^0.2.0", | ||
"eslint": "^2.0.0", | ||
"eslint-config-cssnano": "^2.0.0" | ||
"babel-cli": "^6.0.0", | ||
"cross-env": "^3.0.0" | ||
}, | ||
"homepage": "https://github.com/ben-eb/postcss-discard-empty", | ||
"homepage": "https://github.com/ben-eb/cssnano", | ||
"author": { | ||
@@ -48,9 +38,9 @@ "name": "Ben Briggs", | ||
}, | ||
"repository": "ben-eb/postcss-discard-empty", | ||
"eslintConfig": { | ||
"extends": "cssnano" | ||
"repository": "ben-eb/cssnano", | ||
"bugs": { | ||
"url": "https://github.com/ben-eb/cssnano/issues" | ||
}, | ||
"ava": { | ||
"require": "babel-core/register" | ||
"engines": { | ||
"node": ">=4" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# [postcss][postcss]-discard-empty [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-empty.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-empty.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-empty.svg)][deps] | ||
# [postcss][postcss]-discard-empty | ||
@@ -15,3 +15,3 @@ > Discard empty rules and values with PostCSS. | ||
For more examples see the [tests](test.js). | ||
For more examples see the [tests](src/__tests__/index.js). | ||
@@ -39,7 +39,8 @@ ### Input | ||
## Contributing | ||
Pull requests are welcome. If you add functionality, then please add unit tests | ||
to cover it. | ||
## Contributors | ||
See [CONTRIBUTORS.md](https://github.com/ben-eb/cssnano/blob/master/CONTRIBUTORS.md). | ||
## License | ||
@@ -49,5 +50,3 @@ | ||
[ci]: https://travis-ci.org/ben-eb/postcss-discard-empty | ||
[deps]: https://gemnasium.com/ben-eb/postcss-discard-empty | ||
[npm]: http://badge.fury.io/js/postcss-discard-empty | ||
[postcss]: https://github.com/postcss/postcss |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
2
30
0
4335
50
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedpostcss@6.0.23(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedjs-base64@2.6.4(transitive)
- Removedpostcss@5.2.18(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.03.2.3(transitive)
Updatedpostcss@^6.0.0