-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(all): [v16] Bump eslint and related packages, bump prettier and run on codebase #927
chore(all): [v16] Bump eslint and related packages, bump prettier and run on codebase #927
Conversation
@@ -1,5 +1,5 @@ | |||
#!/usr/bin/env node | |||
|
|||
/* eslint-disable array-callback-return */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling out this specific disable I had to add to avoid changing some .map()
calls below
packages/cli/src/utils/convert.js
Outdated
@@ -40,8 +40,9 @@ const createFile = async (content, filename, dir) => { | |||
endSpinner(); | |||
}; | |||
|
|||
const prettifyJs = (code) => | |||
const prettifyJs = async (code) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier.format returns a Promise since v3. This means renderDefinitionSlice
below which uses prettifyJs
needs to await it. Interestingly, the callers for renderDefinitionSlice
itself already awaited the response 👍🏻
The other usage of prettifyJs
is in renderIndex
which already returns a Promise.
@@ -46,7 +48,7 @@ | |||
"eslint --fix --quiet" | |||
], | |||
"*.{js,json}": [ | |||
"prettier --write" | |||
"prettier --write --ignore-path=.prettierignore" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this has much effect; keeping previous behavior to avoid surprises just in case.
@@ -1,3 +1,3 @@ | |||
module.exports = (z, bundle) => { | |||
return [{ id: 1234 }] || bundle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling out this change I did to fix no-constant-binary-expression
eslint error
879a606
to
f9a0e95
Compare
0d5a9e5
to
6812b4e
Compare
…-bundlers-and-formatters
}); | ||
|
||
module.exports = [{ | ||
ignores: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved .eslintignore
into this ignores
property as required by eslint 9
"packages/cli/scaffold/*.js", | ||
"packages/cli/src/generators/templates/**/*.template.js", | ||
"**/.yarn", | ||
"example-apps/onedrive/test/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I added this new ignore rule for onedrive example app tests; there seems to be some issue with eslint trying to read the .eslintrc.json
in that root directory (?!) which I didn't want to get into...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, yeah that seems reasonable!
@@ -19,7 +19,7 @@ | |||
"/oclif.manifest.json" | |||
], | |||
"engines": { | |||
"node": ">=18" | |||
"node": ">=18.18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this stricter requirement; eslint 9 requires the 18.18 minor version, so I figure it makes sense to enforce this for at least zapier-platform-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whew, that's a lot of commas 😅 Thanks for adding comments on the main changes for this, that made it much easier to review! Looks great 👍
"packages/cli/scaffold/*.js", | ||
"packages/cli/src/generators/templates/**/*.template.js", | ||
"**/.yarn", | ||
"example-apps/onedrive/test/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, yeah that seems reasonable!
349f4b3
into
zapier-platform-major-release-16.0.0-dev
* Param name fixed. * Width of produced markdown docs fixed to 80 chars. * Deps of @oclif packages upgraded. * Command args and flags upgraded. * Run scripts updated. * Tests for ZapierBaseCommand upgraded with command flag tests added. * Tests for register command upgraded. * logList is really printing tables (without borders). * argv parsed. * yarn lock file updated. * Docs updated. * Function name consolidated. * @oclif/core requires node >= 18. * Old code removed. * build(schema-to-ts): [PDE-5183] schema-to-ts is now part of yarn workspace (#913) * BREAKING CHANGE(all): [v16] Bump dependency package versions (#926) * bumping oclif packages * bump more packages * upgrade Yeoman enviornment to latest v3 * dotenv added a package.json * more package upgrades * use promises instead of callback * revert jsonschema upgrade as it breaks a test * bump * upgrade Lerna to v8 * upgrade prettier to latest v3 * run prettier with trailingComma: es5 * upgrade husky * husky followups * Revert "upgrade prettier to latest v3" This reverts commit 840d0ae. * Revert "run prettier with trailingComma: es5" This reverts commit df8a16f. * bump mocha, dotenv and oclif core patch * undo convert changes * chore(all): [v16] Bump eslint and related packages, bump prettier and run on codebase (#927) * bumping oclif packages * bump more packages * upgrade Yeoman enviornment to latest v3 * dotenv added a package.json * more package upgrades * use promises instead of callback * revert jsonschema upgrade as it breaks a test * bump * upgrade Lerna to v8 * upgrade prettier to latest v3 * run prettier with trailingComma: es5 * upgrade husky * husky followups * Revert "upgrade prettier to latest v3" This reverts commit 840d0ae. * Revert "run prettier with trailingComma: es5" This reverts commit df8a16f. * bump mocha, dotenv and oclif core patch * undo convert changes * bump eslint and related packages * prettier bump, run prettier * fix eslintignore * fix test * run over example-apps as well * rebuild yarn.lock * chore(types): Add type for z.request option skipEncodingChars (#928) --------- Co-authored-by: szchenghuang <[email protected]> Co-authored-by: Thomas Cranny <[email protected]>
* chore(all) [PDE-4089]: v16 release development branch (#923) * Param name fixed. * Width of produced markdown docs fixed to 80 chars. * Deps of @oclif packages upgraded. * Command args and flags upgraded. * Run scripts updated. * Tests for ZapierBaseCommand upgraded with command flag tests added. * Tests for register command upgraded. * logList is really printing tables (without borders). * argv parsed. * yarn lock file updated. * Docs updated. * Function name consolidated. * @oclif/core requires node >= 18. * Old code removed. * build(schema-to-ts): [PDE-5183] schema-to-ts is now part of yarn workspace (#913) * BREAKING CHANGE(all): [v16] Bump dependency package versions (#926) * bumping oclif packages * bump more packages * upgrade Yeoman enviornment to latest v3 * dotenv added a package.json * more package upgrades * use promises instead of callback * revert jsonschema upgrade as it breaks a test * bump * upgrade Lerna to v8 * upgrade prettier to latest v3 * run prettier with trailingComma: es5 * upgrade husky * husky followups * Revert "upgrade prettier to latest v3" This reverts commit 840d0ae. * Revert "run prettier with trailingComma: es5" This reverts commit df8a16f. * bump mocha, dotenv and oclif core patch * undo convert changes * chore(all): [v16] Bump eslint and related packages, bump prettier and run on codebase (#927) * bumping oclif packages * bump more packages * upgrade Yeoman enviornment to latest v3 * dotenv added a package.json * more package upgrades * use promises instead of callback * revert jsonschema upgrade as it breaks a test * bump * upgrade Lerna to v8 * upgrade prettier to latest v3 * run prettier with trailingComma: es5 * upgrade husky * husky followups * Revert "upgrade prettier to latest v3" This reverts commit 840d0ae. * Revert "run prettier with trailingComma: es5" This reverts commit df8a16f. * bump mocha, dotenv and oclif core patch * undo convert changes * bump eslint and related packages * prettier bump, run prettier * fix eslintignore * fix test * run over example-apps as well * rebuild yarn.lock * chore(types): Add type for z.request option skipEncodingChars (#928) --------- Co-authored-by: szchenghuang <[email protected]> Co-authored-by: Thomas Cranny <[email protected]> * add changelog * Bump cli, core, schema 15.19.0 -> 16.0.0 --------- Co-authored-by: szchenghuang <[email protected]> Co-authored-by: Thomas Cranny <[email protected]>
Note: This MR is based on top of #926. It should be re-based and merged into the v16 branch after that one is merged.
Packages Updates
eslint
8.32.0 -> 9.16.0eslint-config-prettier
8.6.0 -> 9.16.0eslint-plugin-import
: 2.27.5 -> 2.31.0eslint-plugin-mocha
: 9.0.0 -> 10.5.0eslint-plugin-n
: 15.6.1 -> 17.14.0eslint-plugin-promise
: 6.1.1 -> 7.2.1prettier
: 2.8.3 -> 3.4.1Package Removals
eslint-plugin-standard
: see Eliminate eslint-plugin-standard standard/standard#1316Other Changes
Pin
engine
to>=18.18
for thecli
package, to mirror the upgradedeslint
dependency...The vast majority of the file changes in this PR are due to the
trailingCommas
option in prettier, which had its default value changed from "es5" to "all" in v3.0.0prettier
on the codebase generates a lot of file changes. So I figured we should just keep the default value then..eslintrc
is replaced byeslint.config.cjs
(auto-generated vianpx @eslint/migrate-config .eslintrc --commonjs
according to the migration guide, which then required we installglobals
,@eslint/js
and@eslint/eslintrc
).eslintignore
: "ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files"