vscode-eslint: Server process exited with code 0
When running Eslint in vscode using flat config I get the following output:
[Info - 10:43:56] ESLint server is starting.
[Info - 10:43:56] ESLint server running in node v20.11.0
[Info - 10:43:56] ESLint server is running.
[Info - 10:43:56] ESLint library loaded from: /Users/xxx/app/node_modules/eslint/lib/unsupported-api.js
[Error - 10:43:57] Server process exited with code 0.
The eslint server keeps exiting without saying why.
This is my eslint.config.mjs
import eslint from '@eslint/js';
import prettierPlugin from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
project: ['./apps/*/tsconfig.json', './packages/*/tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
react: reactPlugin,
},
rules: reactPlugin.configs['jsx-runtime'].rules,
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['**/*.tsx'],
plugins: {
'react-hooks': hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
},
{
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
ignores: [
'eslint.config.mjs',
'codegen.ts',
'scripts/',
'**/scripts/',
'**/_generated/',
'**/.*',
'**/babel.config.js',
'**/build/',
'**/config-plugin-caret-color/app.plugin.js',
'**/dist/',
'**/expo-env.d.ts',
'**/generated/',
'**/metro.config.js',
'**/metro.config.ts',
'**/native/app.config.js',
'**/native/app.config.ts',
'**/native/colors.js',
'**/native/plugins/',
'**/tailwind.config.js',
],
},
prettierPlugin,
);
Here are some of my releveant vscode settings:
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.experimental.useFlatConfig": true,
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.workingDirectories": ["./packages/*", "./apps/*"],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"graphql"
],
Eslint works in the terminal and it works for a second or two in vscode after restart of the eslint server.
I have a monorepo project with only one eslint.config.mjs in the root that handles the entire project, no seperate .eslintrc or anything
About this issue
- Original URL
- State: open
- Created 4 months ago
- Reactions: 8
- Comments: 20 (8 by maintainers)
@birgersp your example is actually fine. The exit code 0 comes from the server that is restarted. For some reason it is printed into the new log. I will make this a info and ensure that it shows up in the correct log.