standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
473 stars 36 forks source link

After upgrade to v12 TypeScript Standard Style server is not able to find tsconfig.json #272

Closed wmitrus closed 2 years ago

wmitrus commented 2 years ago

What version of this package are you using? v12.0.1

What operating system, Node.js, and npm version? Windows 10 node -v v16.18.0 npm -v 8.19.2

What happened? My project is configured to work with vscode-standard extension. It works with version 11 of ts-standard. After Upgrade to v12 TypeScript Standard Style server is not able to find tsconfig.json

Output:

Unable to locate the project file. A project file (tsconfig.json or tsconfig.eslint.json) is required in order to use ts-standard.
[Info  - 16:14:04] Connection to server got closed. Server will restart.
[Info  - 16:14:04] TypeScript Standard Style server stopped.
[Info  - 16:14:04] TypeScript Standard Style server stopped.
[Info  - 16:14:05] TypeScript Standard Style server is running.
Unable to locate the project file. A project file (tsconfig.json or tsconfig.eslint.json) is required in order to use ts-standard.
[Error - 16:14:05] The TypeScript Standard Style server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Info  - 16:14:05] TypeScript Standard Style server stopped.

.vscode/settings.json

{
    "editor.formatOnSave": false,
    "editor.formatOnType": false,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "eslint.validate": ["typescript"],
    "standard.autoFixOnSave": true
} 

tsconfig.json

{
  "compilerOptions": {
    /* Language and Environment */
    "target": "es2016",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library 
    /* Modules */
    "module": "commonjs",                                /* Specify what module code is generated. */
    "rootDir": "./",                                  /* Specify the root folder within your source files. */
    "strict": true,                                      /* Enable all strict type-checking options. */
    "skipLibCheck": true                                 /* Skip type checking all .d.ts files. */
  }
}

What did you expect to happen?

Typescript standard engine should do autofix code

Are you willing to submit a pull request to fix this bug?

MarcelBlockchain commented 2 years ago

same problem here

max-starikevich commented 2 years ago

Me too. I had to downgrade to v11 to make it work.

theoludwig commented 2 years ago

Hello, thanks for your report! I see that many people have the same issue.

Unfortunately, I can't reproduce, it works fine on my side (using Ubuntu 22.04, Node.js v18.11.0, npm v8.19.2, ts-standard v12.0.1, VSCode v1.72.2).

Also, all issues related to the VSCode extension should be open on the vscode-standard repository. And this issue is a duplicate of https://github.com/standard/vscode-standard/issues/483.

I will close this issue but please continue investigating and discussing the problem, in the issue linked above, so hopefully, we can find a solution and we can have a way to reproduce it.

Screenshot from 2022-10-21 17-44-00