Coder Social home page Coder Social logo

Comments (2)

ilia-kebets-sonarsource avatar ilia-kebets-sonarsource commented on June 12, 2024

We're not quite sure what to suggest to users.

  1. Using redundant types for developer hints is quite convenient if some value can be several predefined types and custom ones like: foo: 'bar' | 'baz' | string.
  2. We tried to use JS doc for IDE auto-completion, but it didn't work.

We should find a way on what best to suggest to users that use redundant types for documentation or developer tooling.

from sonarjs.

ericmorand-sonarsource avatar ericmorand-sonarsource commented on June 12, 2024

@ilia-kebets-sonarsource , if this is of some help, there is a very typical usage of types redundancy in the typings of DOM events, and the purpose is to give developers a hint about what events are natively supported (and of course enable IDE autocompletion).

For example:

document.addEventListener('DOMContentLoaded', () => { // valid and auto-completed
    
});

document.addEventListener('foo', () => { // valid
    
});

from sonarjs.

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.