|
1 minutes
This package offers a command-line interface and exposes a binary called wp-scripts so you can call it directly with npx – an npm package runner. However, this module is designed to be configured using the scripts section in the package.json file of your project. This comprehensive example demonstrates the most of the capabilities included.
Example:
{
"scripts": {
"build": "wp-scripts build",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"lint:md:docs": "wp-scripts lint-md-docs",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start",
"test:e2e": "wp-scripts test-e2e",
"test:unit": "wp-scripts test-unit-js"
}
}
How to merge multiple dictionaries in Python
def merge_dicts(*dicts):
super_dict = {}
for dict in dicts:
for k, v in dict.items():
super_dict[k] = v
return super_dict
Why does this comparison fail unexpectedly?
int main() {
double a = 0.1;
double sum = 0.0;
for (int i = 0; i < 10; i++) {
sum += a;
}
if (sum == 1.0) {
std::cout << "Sum is 1.0";
} else {
std::cout << "Sum is not 1.0";
}
return 0;
}