Bug 1826062 - Upgrade Prettier to 2.8.8. r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D177026
This commit is contained in:
Mark Banner 2023-05-20 12:26:52 +00:00
parent c987af1ae4
commit 12189bf738
4 changed files with 17 additions and 22 deletions

17
package-lock.json generated
View file

@ -28,7 +28,7 @@
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-spidermonkey-js": "file:tools/lint/eslint/eslint-plugin-spidermonkey-js",
"jsdoc": "4.0.2",
"prettier": "2.0.5",
"prettier": "2.8.8",
"stylelint": "^15.6.0",
"stylelint-config-recommended": "^12.0.0",
"yarn": "1.22.19"
@ -5214,15 +5214,18 @@
}
},
"node_modules/prettier": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/progress": {
@ -10495,9 +10498,9 @@
"dev": true
},
"prettier": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true
},
"progress": {

View file

@ -25,7 +25,7 @@
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-spidermonkey-js": "file:tools/lint/eslint/eslint-plugin-spidermonkey-js",
"jsdoc": "4.0.2",
"prettier": "2.0.5",
"prettier": "2.8.8",
"stylelint": "^15.6.0",
"stylelint-config-recommended": "^12.0.0",
"yarn": "1.22.19"

View file

@ -114,12 +114,11 @@ def lint(paths, config, binary=None, fix=None, rules=[], setup=None, **lintargs)
binary,
os.path.join(module_path, "node_modules", "prettier", "bin-prettier.js"),
"--list-different",
"--no-error-on-unmatched-pattern",
]
+ extra_args
# Prettier does not support exclude arguments.
# + exclude_args
# Prettier only supports this from 2.3 and above (bug 1826062).
# + "--no-error-on-unmatched-pattern",
+ paths
)
log.debug("Prettier command: {}".format(" ".join(cmd_args)))
@ -223,17 +222,10 @@ def run_prettier(cmd_args, config, fix):
errors = [
error
for error in errors
if not (
"No supported files were found" in error
or "No files matching the pattern were found" in error
# Unknown options are not an issue for Prettier, this avoids
# errors during tests.
or "Ignored unknown option" in error
)
# Unknown options are not an issue for Prettier, this avoids
# errors during tests.
if not ("Ignored unknown option" in error)
]
# --no-error-on-unmatched-pattern was only added in Prettier 2.3,
# when we upgrade to the latest version (bug 1826062), we can pass in
# that argument and remove this check.
if len(errors):
print(PRETTIER_ERROR_MESSAGE.format("\n".join(errors)))

View file

@ -1,9 +1,9 @@
[
{
"filename": "eslint.tar.gz",
"size": 25695117,
"size": 25984466,
"algorithm": "sha512",
"digest": "bf0380a802a31ea3d7f9228a4d94a8f08c07dd5bf687247b15f7c8fb1e1c547ab791e4023e3cf20a91fb39a40dffeba1624c7ad168da01c5328263b20ae65624",
"digest": "6a06bc35ebf8b6e523f23aba3a23f02a79eec61baa1bc39287672baac09c03f9f38c26b8c385bc5a8b02d11630aa5b9c700761ac86cbb19a40f5bc0f6cbff87c",
"unpack": true,
"visibility": "public"
}