Git Product home page Git Product logo

Comments (8)

tronza avatar tronza commented on August 18, 2024 2

This suppressImplicitAnyIndexErrors shouldn't probably be true by default. Why should it be? It suppresses quite bad errors, i.e.:

const key = 'someString';
const value: boolean = false;
const result = value[key]; // would be highlighted if `suppressImplicitAnyIndexErrors` weren't true

from create-react-app-typescript.

FredrikNoren avatar FredrikNoren commented on August 18, 2024

Hm something else is wrong, the tsconfig.json is read (if I break it things won't compile)

from create-react-app-typescript.

FredrikNoren avatar FredrikNoren commented on August 18, 2024

Looks like it works if I directly invoke tsc:

~/GitHub/my-app$ ./node_modules/typescript/bin/tsc --noImplicitAny --jsx react src/App.tsx
src/App.tsx(8,11): error TS7017: Element implicitly has an 'any' type because type 'X' has no index signature.

from create-react-app-typescript.

wmonk avatar wmonk commented on August 18, 2024

Any update on this? I'm surprised that nobody else using this package has reported the same issue.

from create-react-app-typescript.

FredrikNoren avatar FredrikNoren commented on August 18, 2024

@wmonk I just tried the repro steps and still doesn't work for me. Does it work for you?

from create-react-app-typescript.

tko avatar tko commented on August 18, 2024

Looks like the generated tsconfig.json is explicitly suppressing that error with

    "suppressImplicitAnyIndexErrors": true,

from create-react-app-typescript.

FredrikNoren avatar FredrikNoren commented on August 18, 2024

Oh I'm blind.. yes you're right, that explains everything. Thank you @tko!

from create-react-app-typescript.

jyrodrigues avatar jyrodrigues commented on August 18, 2024

Why maintain suppressImplicitAnyIndexErrors set to true by default? Could anyone point me to some resource on the reasoning behind it?

In what case is it better to suppress this kind of warning?

from create-react-app-typescript.

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.