Skip to content

allowArbitraryExtensions does not work as expected #55507

Description

🔎 Search Terms

allowArbitraryExtensions

🕗 Version & Regression Information

  • This is unexpected error from Typescript@5.0

⏯ Playground Link

https://codesandbox.io/p/sandbox/typescript-playground-export-forked-mfz7rg?file=/index.ts:10,28

💻 Code

import {} from "./app.css";

export {};

my tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "module": "ESNext",
    "target": "ESNext",
    "lib": [
      "ESNext",
      "DOM",
      "DOM.Iterable"
    ],
    "moduleResolution": "bundler",
    "customConditions": [
      "dev"
    ],
    "jsx": "react-jsx",
    "declaration": true,
    "emitDeclarationOnly": true,
    "isolatedModules": true,
    "strict": true,
    "allowJs": true,
    "skipDefaultLibCheck": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "allowArbitraryExtensions": true,
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "sourceMap": false,
    "rootDirs": [
      "./src",
      "./esm"
    ],
    "outDir": "./esm"
  },
  "include": [
    "./src/**/*"
  ]
}

🙁 Actual behavior

I have set allowArbitraryExtensions to true, but it still throw error when import a .css file.
As mentioned in document:

you can suppress the error with the new --allowArbitraryExtensions compiler option.

🙂 Expected behavior

should not throw error

Additional information about the issue

issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions