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

typescript linting issues with bundled /src folder #21

Open
itsjavi opened this issue Nov 22, 2023 · 0 comments
Open

typescript linting issues with bundled /src folder #21

itsjavi opened this issue Nov 22, 2023 · 0 comments

Comments

@itsjavi
Copy link

itsjavi commented Nov 22, 2023

Is there any reason why the src/ folder is bundled in the npm package?

It would be better to remove it to avoid conflicts with user's tsconfig.

I get this issue when running tsc --noEmit --skipLibcheck:

node_modules/.pnpm/@elysiajs+static@0.7.1_elysia@0.7.29/node_modules/
   @elysiajs/static/src/index.ts:164:29 - 
error TS6133: 'error' is declared but its value is never read.

My tsconfig:

{
  "compilerOptions": {
    "composite": false,
    "target": "ES2021",
    "module": "ESNext",
    "lib": ["ES2021", "DOM", "DOM.Iterable"],
    "skipLibCheck": true,
    "preserveWatchOutput": true,

    /* Bundling */
    "moduleResolution": "bundler",
    "esModuleInterop": true,
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "declaration": true,
    "declarationMap": true,
    "inlineSources": false,
    "allowArbitraryExtensions": true,

    /* Linting */
    "strict": true,
    "strictNullChecks": true,
    "noUnusedLocals": true, // ---> this triggers the issue
    "noUnusedParameters": true,
    "noUncheckedIndexedAccess": true,
    "noFallthroughCasesInSwitch": true,
    "useDefineForClassFields": true,
    "verbatimModuleSyntax": true,
    "forceConsistentCasingInFileNames": true,

    /* Paths and files */
    "types": ["@types/node", "jest", "bun-types"]
  },
  "include": ["src", "*.ts"],
  "exclude": ["node_modules", "dist", "build", "coverage"]
}

As a temporary workaround, I am using the js dist files

import { staticPlugin } from "@elysiajs/static/dist";
@itsjavi itsjavi changed the title typescript linting issues typescript linting issues with bundled /src folder Nov 22, 2023
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

No branches or pull requests

1 participant