You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating an SDK using the speakeasy quickstart command in a directory that uses the new ESLint flat config file, eslintrc.js, the SDK folder is created but I get linting errors in the terminal:
...
86:66 error Strings must use singlequote style/quotes
87:5 error Closing curly brace appears on the same line as the subsequent block style/brace-
...
I don't get the error if I run the speakeasy quickstart command from outside the project or in a project that uses the old ESLint config file format, eslintrc.js.
I guess the error occurs because of the configuration file resolution. When ESLint is run on the command line, it first checks the current working directory for an eslint.config.js, eslint.config.mjs, or eslint.config.cjs file. If none of the files are found, it checks the parent directory for each file - the project's eslintrc.js file, which finds linting errors in the SDK folder.
Speakeasy targets customers who want to publish SDKs as standalone npm packages, where this issue won't occur.
However, this issue may occur for users who are testing out Speakeasy.
Install all dependencies for the application using NPM:
npm install
Create a Speakeasy SDK:
speakeasy quickstart
Expected result
No ESLint errors
Actual result
Linting errors caused by the project's eslint.config.mjs file:
...
86:66 error Strings must use singlequote style/quotes
87:5 error Closing curly brace appears on the same line as the subsequent block style/brace-
...
Workaround
Run the speakeasy quickstart command from outside the project.
Potential solution
Eslint recommends migrating to the new flat config system. If that's not an option you can keep using .eslintrc.cjs,by preventing the search for eslint.config.js using the -c or --config option on the command line to specify an alternate configuration file. In the SDK package.json file, adding --config .eslintrc.cjs to the lint script might prevent the error.
simplesagar
changed the title
SDK in project using new ESLint flat config file causes linting errors
[SPE-4417] SDK in project using new ESLint flat config file causes linting errors
Nov 4, 2024
When generating an SDK using the
speakeasy quickstart
command in a directory that uses the new ESLint flat config file,eslintrc.js
, the SDK folder is created but I get linting errors in the terminal:I don't get the error if I run the
speakeasy quickstart
command from outside the project or in a project that uses the old ESLint config file format,eslintrc.js
.I guess the error occurs because of the configuration file resolution. When ESLint is run on the command line, it first checks the current working directory for an
eslint.config.js
,eslint.config.mjs
, oreslint.config.cjs
file. If none of the files are found, it checks the parent directory for each file - the project'seslintrc.js
file, which finds linting errors in the SDK folder.Speakeasy targets customers who want to publish SDKs as standalone npm packages, where this issue won't occur.
However, this issue may occur for users who are testing out Speakeasy.
Steps
cd speakeasy-hono-openapi-sdk-starter
Expected result
No ESLint errors
Actual result
Linting errors caused by the project's
eslint.config.mjs
file:Workaround
Run the
speakeasy quickstart
command from outside the project.Potential solution
Eslint recommends migrating to the new flat config system. If that's not an option you can keep using
.eslintrc.cjs
,by preventing the search foreslint.config.js
using the-c
or--config
option on the command line to specify an alternate configuration file. In the SDKpackage.json
file, adding--config .eslintrc.cjs
to the lint script might prevent the error.SPE-4417
The text was updated successfully, but these errors were encountered: