Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(strictest): add noUncheckedSideEffectImports option #276

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zanminkian
Copy link
Contributor

Closes #275.

This flag was introduced in TS 5.6

@orta
Copy link
Member

orta commented Oct 31, 2024

I don't think this should be in strictest, I think it's something that a lot of people use for .css files etc - its useful as a linter but not something I'd say should be in strictest

@zanminkian
Copy link
Contributor Author

If people import .css files, they usually add a shims.d.ts file in there project.

// shims.d.ts
declare module "*.css" {
  declare const css: unknown;
  export default css;
}

As for me, personally, I use triple slash directive at the beginning of the app entrance file.

// main.tsx
/// <reference types="vite/client" />
import "tailwindcss/tailwind.css";
import ReactDOM from "react-dom/client";
import { App } from "./App.jsx";

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
ReactDOM.createRoot(document.getElementById("root")!).render(<App />);

@jakebailey
Copy link

Yeah, this is what vite generates for you.

I'd really like to make this flag enabled by default in strict mode at some point.

@zanminkian
Copy link
Contributor Author

zanminkian commented Nov 26, 2024

Is it possible that we enable this flag when strict: true in TS 6.0? @jakebailey

@jakebailey
Copy link

I'll try to see if it can be enabled in 6.0 but I don't quite know for sure. It's a very breaky flag for many people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

noUncheckedSideEffectImports needs to be added to strictest
3 participants