Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7843
Closed
Open
Issue created Oct 30, 2020 by Administrator@rootContributor

[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
  1. Clone the repo, and build with mvn clean install
  2. Run the generate command above
  3. Run ESLint on the generated expressServer.js: npx eslint expressServer.js or yarn 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.

Assignee
Assign to
Time tracking