Giter Site home page Giter Site logo

Comments (9)

DimitryDushkin avatar DimitryDushkin commented on May 22, 2024 3

Hey! Is auto-fix available now?

from tslint-language-service.

angelozerr avatar angelozerr commented on May 22, 2024 1

I work on a PR that addresses several of the above issues.

Very cool!

Quick fix for fixing all auto fixable rule failures
Quick fix for fixing all rule failures for a particular rule

I think this feature should be supported by tsserver, no? But for the moment we could implement it.

Auto fix on save

I tell me more and more if getSemanticDiagnostics should have a context parameter. The context parameter is filled by the editor client and in our case we could ignore error or not. In Eclipse, I would like to have this parameter too to ignore compute of tslint fix when there is compile on save which is executed (in this case I don't need to compute fix for ts files which depends of the ts file which is saved).

I see several values for this context:

  • onType
  • onSave
  • onCompile

Those values could be filled with a tsserver request when semantic command is called.

Revalidate open files when the tslint.json configuration file changes.

Could you create an issue at TypeScript please?

Intellisense for language service plugins

What do you mean?

support to create a default tslint.json

In typescript.java I provide a wizard which generates tslint.json with tslint --init

custom path to node modules directory, used to load tslint from a different location than the default of the current workspace or the global node modules directory.

It seems that TypeScript 2.4 will provide "global" plugins, perhaps it will fix this issue?

from tslint-language-service.

egamma avatar egamma commented on May 22, 2024

Quick fix for fixing all auto fixable rule failures
Quick fix for fixing all rule failures for a particular rule

I think this feature should be supported by tsserver, no? But for the moment we could implement it.

Fair question, auto fixing has become popular for linters, but less so for general semantic language errors. So I suggest that we implement it first.

Auto fix on save

I tell me more and more if getSemanticDiagnostics should have a context parameter.

The more interesting issue is related to applying the code fixes, the changes must be applied before the save operation so that a document is not saved twice. This needs a new hook like aboutToSave that enables to apply changes.

Intellisense for language service plugins

What do you mean?

VS Code provides Intellisense when editing a tsconfig.son, see below. You want to have the same comfort when a plugin provides settings that you want to configure.

image

image

support to create a default tslint.json

In typescript.java I provide a wizard which generates tslint.json with tslint --init

This makes sense, vscode-tslint does something similar.

It seems that TypeScript 2.4 will provide "global" plugins, perhaps it will fix this issue?

This allows to configure a plugin globally, not clear to me yet, how global plugins support module dependencies of a plugin. Do you have a pointer with the latest on this?

from tslint-language-service.

angelozerr avatar angelozerr commented on May 22, 2024

So I suggest that we implement it first.

Ok!

This needs a new hook like aboutToSave that enables to apply changes.

Is it an issue for TypeScript or VSCode?

You want to have the same comfort when a plugin provides settings that you want to configure.

Thanks for the clarification. I think tslint-language-service should provide that (when getExtranlFiles will be implemented), no?

Do you have a pointer with the latest on this?

The only info that I have about global plugin is angular/vscode-ng-language-service#43 (comment)

from tslint-language-service.

egamma avatar egamma commented on May 22, 2024

This needs a new hook like aboutToSave that enables to apply changes.

Is it an issue for TypeScript or VSCode?

The typescript language server needs to provide a hook for aboutToSave to plugins. It also needs to provide a way for a tool like VS Code or Eclipse to inform that TypeScript server that an about to save is about to happen.

You want to have the same comfort when a plugin provides settings that you want to configure.

Thanks for the clarification. I think tslint-language-service should provide that (when getExtranlFiles will be implemented), no?

This would be possible, but the tsconfig.json file is a JSON file for which there is a JSON language service that can provide validation based on JSON schemas (and there is a schema for tsconfig.json). I would not want to duplicate this and compete with the JSON language service inside the tslint-language-service. What I suggest is that a plugin can provide a JSON schema fragment for its plugin attributes and the JSON language service can consume it and use it for validation (BTW, the VS Code JSON language server can also be used from Eclipse).

from tslint-language-service.

egamma avatar egamma commented on May 22, 2024

Regarding global plugins

This is already supported you can pass the TS server as set of plugin locations (directories) on the command line and the TS server will load plugins from these locations. This is used in VS Code to support loading a TS language server from a VS Code extension. This is what I'm doing in the preview of the 'tslint' plugin extension https://marketplace.visualstudio.com/items?itemName=eg2.ts-tslint

from tslint-language-service.

probert94 avatar probert94 commented on May 22, 2024

The no-unused-variable-rule is disabled by default
As a workaround you can use noUnusedParameters in tsconfig.json.
This however has a drawback with Angular AOT build:
angular/angular#17131

from tslint-language-service.

jrylan avatar jrylan commented on May 22, 2024

One other strange gap that I felt is important to note for this discussion is that VS Code currently only calls out to getFormattingEditsForRange in the TS Language Service, and never attempts to call getFormattingEditsForDocument.

from tslint-language-service.

chemzqm avatar chemzqm commented on May 22, 2024

Looks like no-unused-variable-rule is always disabled in tslint-language-service, any way I could make use of that? I don't like set allowUnusedVariable in tsconfig.json, since it doesn't allow me skip some variables.

from tslint-language-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.