Comments (10)
typescript-language-server supported ESLint/TSLint by plugins:
typescript-language-server/typescript-language-server#58
typescript-language-server/typescript-language-server#73
and, found ESLint plugin:
https://github.com/Quramy/typescript-eslint-language-service
Example usage in semicolon test case.
files
.
├── main.js
├── tsconfig.json
└── .eslintrc.yml
Intall node_modules
$ # `typescript` need install, hmm.
$ npm init -y
$ npm install \
eslint \
typescript \
typescript-eslint-language-service \
@typescript-eslint/parser \
@typescript-eslint/typescript-estree
main.js
const message = 'hello';
console.log(message) // error
tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"plugins": [
{
"name": "typescript-eslint-language-service"
}
]
}
}
.eslintrc.yml
parser: "@typescript-eslint/parser"
rules:
semi: error
from vim-lsp-settings.
If you want to enable eslint always on typescript-language-server, you can specify plugin
for initialization_options
like @wordijp's comment.
from vim-lsp-settings.
What if my eslint config is named .eslintrc.json
?
Edit: works too.
from vim-lsp-settings.
Just replace yaml to json.
.eslintrc.json
{
"parser": "@typescript-eslint/parser",
"rules" : {
"semi": "error"
}
}
from vim-lsp-settings.
Apparently, it needs the dependencies to be installed locally. I had typescript-language-server installed globally, so I thought global install would work.
from vim-lsp-settings.
Ok, the issue was that I already had [email protected]
installed. yarn add eslint
added version ^6.7
which is resolved to 6.8.0
and is incompatible with eslint plugins I had installed.
from vim-lsp-settings.
Thanks. Lessons learned:
- Make sure
eslint
command works and produces lint errors - Make sure to install
typescript-eslint-language-service
locally instead of globally - Add
typescript-eslint-language-service
totsconfig.json
plugins - Make sure
@typescript-eslint/parser
parser is used for*.ts
files
Small question: is there any noticeable difference between typescript-eslint-language-service
and vscode-eslint
? That is, would VSCode user notice the difference?
from vim-lsp-settings.
I checked each language server system.
I think the user experience depends on each editor, It seems that there is no difference in Linter result.
Because both are plugins that bridge the language server and eslint.
vscode-eslint
bridges vscode-languageserver
and eslint
.
typescript-eslint-language-service
bridges typescript-language-server
plugin and eslint
.
Supplementary information: please see typescript-eslint-language-service
author's slide, slide=17
is system image page.
https://quramy.github.io/ts-eslint-talk/#slide=17
from vim-lsp-settings.
So typescript-eslint-language-service
requires typescript-language-server
? It seemed to work without it.
from vim-lsp-settings.
Anyway, I got it running, thank you for your help!
from vim-lsp-settings.
Related Issues (20)
- Managing upgrades of installed servers
- LSP action broken (apply_workspace_edit) HOT 1
- sumneko needs a meta folder to support builtins
- How to set lsp_settings_filetype_ with LspSettingsLocalEdit
- ruff lsp is weird, potentially add to readme? HOT 1
- Add pylizer
- There's no installer for vimscript-language-server HOT 4
- install-terraform-ls.sh curling non-existant file HOT 4
- customTags for yaml-language-server HOT 2
- term_start function unknown error HOT 2
- Add support for YANG LSP
- COBOL not working? HOT 2
- Java doesn't work on Windows 10
- `vscode-css-languageserver-bin` is too outdated.
- Could not find an installable clangd release HOT 1
- `:LspStatus` returns `typescript-language-server: not running` HOT 5
- The steep language server started when Steepfile not exists HOT 3
- install-helm-ls.sh is not executable by default HOT 3
- Command for checking if a LSP is available for a specific filetype
- OCaml Compiler version mismatch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-lsp-settings.