Skip to content
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

Update eslint/prettier versions in the OpenAPI formats generator #148

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/generator-spectral/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prismatic-io/generator-spectral",
"version": "2.2.0",
"version": "2.2.1",
"description": "Yeoman generator for scaffolding out Prismatic components",
"keywords": [
"prismatic",
Expand Down
14 changes: 10 additions & 4 deletions packages/generator-spectral/src/generators/formats/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class FormatsGenerator extends Generator {
}

async initializing() {
if (!this.options.name) {
throw new Error("Name of component must be specified.");
}

if (!this.options.openapi) {
throw new Error("Path to OpenAPI specification must be specified.");
}
Expand Down Expand Up @@ -76,7 +80,7 @@ class FormatsGenerator extends Generator {
test: "jest --runInBand",
lint: "eslint --quiet --ext .ts .",
"lint-fix": "eslint --quiet --ext .ts --fix .",
format: "npm run lint-fix && prettier --loglevel error --write .",
format: "npm run lint-fix && prettier --log-level error --write .",
},
eslintConfig: {
root: true,
Expand All @@ -85,7 +89,10 @@ class FormatsGenerator extends Generator {
});

await this.addDependencies("@prismatic-io/spectral");
await this.addDevDependencies("@prismatic-io/eslint-config-spectral");
await this.addDevDependencies([
"eslint",
"@prismatic-io/eslint-config-spectral",
]);
await this.addDevDependencies({
"@types/jest": "25.2.3",
"copy-webpack-plugin": "10.2.4",
Expand All @@ -95,8 +102,7 @@ class FormatsGenerator extends Generator {
typescript: "4.6.3",
webpack: "5.72.0",
"webpack-cli": "4.9.2",
eslint: "6.8.0",
prettier: "2.0.5",
prettier: "3.0.3",
});

const result = await read(this.values.openapi);
Expand Down