Skip to content

Commit 1a9a79b

Browse files
committed
add updated eslint to package.json
1 parent 60df983 commit 1a9a79b

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"devDependencies": {
2727
"@wordpress/scripts": "^30.19.0",
28+
"eslint-config-prettier": "^10.1.8",
2829
"standard-version": "^9.5.0"
2930
},
3031
"files": [

wp-plugin-version-updater.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module.exports.readVersion = function (contents) {
2-
const capturingRegex = /Version: (?<vnum>[0-9]+\.[0-9]+\.[0-9]+)/;
2+
const capturingRegex = /Version:\s*(?<vnum>[0-9]+\.[0-9]+\.[0-9]+)/;
33
const found = contents.match(capturingRegex);
4-
if (!found) return null; // or handle the error appropriately
4+
if (!found) return null;
55
return found.groups.vnum;
66
};
77

88
module.exports.writeVersion = function (_contents, version) {
9-
const regex = /Version: (?<vnum>[0-9]+\.[0-9]+\.[0-9]+)/;
10-
return _contents.replace(regex, "Version: " + version);
9+
const regex = /Version:\s*[0-9]+\.[0-9]+\.[0-9]+/;
10+
return _contents.replace(regex, "Version: " + version);
1111
};

0 commit comments

Comments
 (0)