Git Product home page Git Product logo

Comments (4)

almondtools avatar almondtools commented on August 15, 2024 1

Problems occur with webpack 4 together with gulp/webpack-stream. In this case the fileName is omitted completely leaving:

[3, 17]: Type boolean trivially inferred from a boolean literal, remove type annotation

while e.g ts-loader displays:

 [tsl] ERROR in path/to.ts(35,5)
      TS2531: Object is possibly 'null'.

from tslint-loader.

crenshaw-dev avatar crenshaw-dev commented on August 15, 2024

@almondtools any workaround? I'm experiencing the same issue. Super frustrating when enabling tslint on an existing codebase. Could take a long time to hunt down these errors.

from tslint-loader.

almondtools avatar almondtools commented on August 15, 2024

I tried to fix this issue in a fork, yet this lets every unit test fail. So this would have meant a complete API change and I think it should be confirmed by the project owner.

However I found out that a custom formatter has access to more information. Look at the file customFormatter.js and prepend failure.fileName to positionTuple. To include a custom formatter you have to configure the formatter directory and the name of the new formatter.

from tslint-loader.

crenshaw-dev avatar crenshaw-dev commented on August 15, 2024

Took some trial-and-error to get it right.

Options:

{
    formatter: 'michael',
    formattersDirectory: 'tslint-formatters'
}

I created the file tslint-formatters/michaelFormatter.js and copied/pasted the contents of customFormatter.js linked above. I made the one tweak @almondtools mentioned. No need to change the Formatter name in the file.

Thanks for the help!

from tslint-loader.

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.