[BUG][node-express-server] .eslintrc.json extends "airbnb" but should be "airbnb-base"
Created by: MatthewEppelsheimer
Description
The .eslintrc.json generated from eslintrc.mustache attempts to extend the airbnb config plugin. This is incompatible with the eslint-config-airbnb-base included as a dev dependency in the package.json generated by package.mustache. ESLint generates an error: Cannot find module 'eslint-config-airbnb'.
openapi-generator version
Discovered on stable 4.3.1, confirmed on master. Looks like it was introduced in 4.3.0 by https://github.com/OpenAPITools/openapi-generator/pull/5675.
OpenAPI declaration file content or url
Reproduced with the Petstore demo example at https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
Command line used for generation
java -jar ~/dev/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
--generator-name nodejs-express-server \
--input-spec https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
--output build/
Steps to reproduce
- Clone the repo, and build with
mvn clean install - Run the
generatecommand above - Run ESLint on the generated
expressServer.js:npx eslint expressServer.jsoryarn run eslint expressServer.js
Note: Once this issue is fixed, ESLint finds some errors that I consider out of scope of this issue — but after this is fixed, it is at least able to run.
Related issues/PRs
I searched but didn't find any.
Suggest a fix/enhancement
This is a simple fix: Updating eslintrc.mustache to extend airbnb-base resolves this.
It makes sense to stick with eslint-config-airbnb-base, which "provides Airbnb's base JS .eslintrc (without React plugins)" (quoting eslint-config-airbnb-base's description).
I'm working on a PR.