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
Add plugin.js support #10763
base: master
Are you sure you want to change the base?
Add plugin.js support #10763
Conversation
Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
This is fine... Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
I am not opposed to defining plugin configuration information this way 👍 |
@barisusakli @psychobunny what you guys think? |
configPath = path.join(paths.nodeModules, plugin, 'plugin.js'); | ||
} | ||
// eslint-disable-next-line no-await-in-loop | ||
if (!await file.exists(configPath)) { |
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.
This if block should move into the above if block, otherwise if there is a plugin.json we are doing 2x file.exists(configPath) checks with the same configPath
value.
Sometimes it would be better to use a full blown script for plugin manifest because we can use it to resolve some complicated stuff and future type stubs for code safety*. This practice is basically everywhere. SWC, ESLint, Mocha, Jest all allows such use.
For my own sake, this also added a slightly good benefit of lexicographically sorting the fields thanks to ESLint. My OCD hits when I see the fields not being sorted from A to Z.
*: if you used a TypeScript transpiler, that is what most people should start doing.
Missing