Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rule no-undef doesn't work? #125

Closed
Napoleon-Jm opened this issue Feb 3, 2022 · 6 comments
Closed

The rule no-undef doesn't work? #125

Napoleon-Jm opened this issue Feb 3, 2022 · 6 comments
Labels
Can't reproduce This doesn't seem right

Comments

@Napoleon-Jm
Copy link

Napoleon-Jm commented Feb 3, 2022

The "no-undef" rule is not work in cos-eslint, but it's worked on my vscode(same js code).
And other lint error tips' ok, did I miss something to config?

There is nothing special on my coc config, almost is default.

Add below code to my js file, and saved,

abc=bac

Both of them(abc, bcd) should be lint a "no-undef", while vscode does, but coc not.

@chemzqm chemzqm added the Can't reproduce This doesn't seem right label Feb 3, 2022
@chemzqm
Copy link
Member

chemzqm commented Feb 3, 2022

@Napoleon-Jm
Copy link
Author

Napoleon-Jm commented Feb 4, 2022

Checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

The output:

`
[Info - 8:16:16 ├F10: PM┤] Local tsserver not found, using bundled tsserver with coc-tsserver.
[Info - 8:16:16 ├F10: PM┤] using npm from /Users/jimin/.nvm/versions/node/v12.22.0/bin/npm
[Info - 8:16:16 ├F10: PM┤] Forking TSServer
PATH: /Users/jimin/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js
[Info - 8:16:16 ├F10: PM┤] Starting TSServer
{
"path": "/Users/jimin/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib",
"_pathLabel": "",
"_api": {
"versionString": "4.5.5",
"version": "4.5.5"
}
}
[Trace - 8:16:16 ├F10: PM┤] Sending request: configure (0). Response expected: no. Current queue length: 0
Arguments: {
"hostInfo": "coc-nvim",
"preferences": {
"providePrefixAndSuffixTextForRename": true,
"allowRenameOfImportPath": true,
"includePackageJsonAutoImports": "auto"
}
}
[Trace - 8:16:16 ├F10: PM┤] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0
Arguments: {
"options": {
"module": "commonjs",
"target": "es2016",
"jsx": "preserve",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"allowNonTsExtensions": true
}
}
[Trace - 8:16:16 ├F10: PM┤] Event received: typingsInstallerPid (0).
Data: {
"pid": 6355
}
[Trace - 8:16:16 ├F10: PM┤] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0
Arguments: {
"changedFiles": [],
"closedFiles": [],
"openFiles": [
{
"file": "/Users/jimin/MyWorkSpace/js2uml/src/js2seq/index.js",
"fileContent": "\nclass Js2Seq {\n\n constructor(a) {\n this.a = a;\n }\n\n abc = b;\n static convert() {\n return null;\n }\n}\n\nexport {\n Js2Seq,\n};\n",
"projectRootPath": "/Users/jimin/MyWorkSpace/js2uml",
"scriptKindName": "JS"
}
]
}
[Trace - 8:16:17 ├F10: PM┤] Response received: updateOpen (2). Request took 1493 ms. Success: true
Result: true
[Trace - 8:16:17 ├F10: PM┤] Sending request: geterr (3). Response expected: yes. Current queue length: 0
Arguments: {
"delay": 0,
"files": [
"/Users/jimin/MyWorkSpace/js2uml/src/js2seq/index.js"
]
}

`

.eslintrc

`
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
}
}

`

@chemzqm The fileContent as the code upon, has a abc = b, that will caused a undef lint tip in vscode, but coc doesn't.

@chemzqm
Copy link
Member

chemzqm commented Feb 4, 2022

The output is from tsserver, not eslint.

@chemzqm
Copy link
Member

chemzqm commented Feb 4, 2022

Maybe you have "typescript.showUnused": false config

@Napoleon-Jm
Copy link
Author

Napoleon-Jm commented Feb 4, 2022

The eslintrc has upload on my first replay,

:CocCommand workspace.showOutput

just give me two options.... watchman or tsserver

@chemzqm
Copy link
Member

chemzqm commented Feb 4, 2022

Seems you don't have eslint server running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't reproduce This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants