Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

How to ignore node_modules package checks ? #52

Closed
@you227

Description

@you227
vue-tsc --noEmit && vite build --mode production

message

> build
> vue-tsc --noEmit && vite build --mode production

node_modules/element-plus/lib/el-cascader-panel/index.d.ts:5:15 - error TS2307: Cannot find module './src/types' or its corresponding type declarations.

5 export * from './src/types';
                ~~~~~~~~~~~~~

node_modules/element-plus/lib/el-cascader-panel/src/config.d.ts:2:93 - error TS2307: Cannot find module './types' or its corresponding type declarations.

2 import { CascaderValue, CascaderOption, CascaderConfig, CascaderProps, ExpandTrigger } from './types';
                                                                                              ~~~~~~~~~

node_modules/element-plus/lib/el-cascader-panel/src/index.vue.d.ts:2:18 - error TS2307: Cannot find module './node' or its corresponding type declarations.

2 import Node from './node';

Activity

Shinigami92

Shinigami92 commented on Jul 28, 2021

@Shinigami92

Try adding "exclude": ["node_modules"] in your tsconfig.json

you227

you227 commented on Jul 28, 2021

@you227
Author

Added configuration but it didn't work

vue-tsc version 0.2.2

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "paths": {
    // 根据别名配置相关路径
      "@/*": ["./src/*"]
    },
  },
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
  "exclude": ["node_modules"],
}
johnsoncodehk

johnsoncodehk commented on Jul 28, 2021

@johnsoncodehk
Owner

Please config skipLibCheck in tsconfig or --skipLibCheck in cli. See #16 (comment).

you227

you227 commented on Jul 29, 2021

@you227
Author

@johnsoncodehk
Added the vue-tsc --noEmit --skipLibCheck command, the *.d.ts file was ignored, but the *.ts file was still scanned

--skipLibCheck Skip type checking of declaration files.

vue-tsc --noEmit --skipLibCheck

output

> build
> vue-tsc --noEmit --skipLibCheck && vite build --mode production

node_modules/element-plus/lib/utils/types.ts:24:26 - error TS2304: Cannot find name 'Nullable'.

24 export type RefElement = Nullable<HTMLElement>
johnsoncodehk

johnsoncodehk commented on Jul 29, 2021

@johnsoncodehk
Owner

@you227 Maybe node_modules/element-plus/lib/utils/types.ts has references in src so it can't be ignore.

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

    duplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Shinigami92@johnsoncodehk@you227

        Issue actions

          How to ignore node_modules package checks ? · Issue #52 · johnsoncodehk/vue-tsc