tulsiojha / nepali-datepicker-react

Nepali Datepicker React is a lightweight, highly customizable, and feature-rich datepicker component, specifically designed for handling Nepali dates in React.js applications. It offers seamless integration, intuitive user experience, and extensive configuration options.
https://nepali-datepicker-react.ojhabikash.com.np/
MIT License
1 stars 0 forks source link

Could not find a declaration file for module '@zener/nepali-datepicker-react'. #2

Open dipbazz opened 2 days ago

dipbazz commented 2 days ago

Could not find a declaration file for module '@zener/nepali-datepicker-react'. '/path/of/project/node_modules/@zener/nepali-datepicker-react/dist/index.js' implicitly has an 'any' type. There are types at '/path/of/project/node_modules/@zener/nepali-datepicker-react/dist/@types/datepicker/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

My package version are as below:

 {
  "name": "react-project",
  "version": "0.1.0",
  "private": true,
  "type": "module",
  "dependencies": {
    "@ant-design/icons": "^5.0.1",
    "@nivo/bar": "^0.87.0",
    "@nivo/pie": "^0.87.0",
    "@refinedev/antd": "^5.43.1",
    "@refinedev/cli": "^2.16.38",
    "@refinedev/core": "^4.54.1",
    "@refinedev/kbar": "^1.3.6",
    "@refinedev/react-router-v6": "^4.6.0",
    "@refinedev/simple-rest": "^5.0.1",
    "@zener/nepali-datepicker-react": "^1.0.5",
    "antd": "^5.0.5",
    "axios-auth-refresh": "^3.3.6",
    "nepali-date-converter": "^3.3.2",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-router-dom": "^6.8.1"
  },
  "devDependencies": {
    "@types/node": "^18.16.2",
    "@types/react": "^18.0.0",
    "@types/react-dom": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^5.57.1",
    "@typescript-eslint/parser": "^5.57.1",
    "@vitejs/plugin-react": "^4.0.0",
    "eslint": "^8.38.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "rollup-plugin-visualizer": "^5.12.0",
    "typescript": "^4.9.3",
    "vite": "^4.3.1",
    "vite-tsconfig-paths": "^4.3.2",
    "vitest": "^0.34.4"
  },
  "scripts": {
    "dev": "refine dev --host",
    "build": "tsc && refine build",
    "preview": "refine start",
    "refine": "refine"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

My tsconfig.json

 {
  "compilerOptions": {
    "target": "ESNext",
    "useDefineForClassFields": true,
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "allowJs": false,
    "skipLibCheck": true,
    "esModuleInterop": false,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "ESNext",
    "moduleResolution": "Node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "declaration": true,
    "jsx": "react-jsx",
    "baseUrl": "./src",
  },
  "include": ["src", "vite.config.ts"],
  "references": [
    {
      "path": "./tsconfig.node.json"
    }
  ]
}

My tsconfig.node.json

{
  "compilerOptions": {
    "composite": true,
    "module": "ESNext",
    "moduleResolution": "node"
  },
  "include": ["vite.config.ts"]
}

If I change my module from ESNext to the above suggested value 'node16', 'nodenext', or 'bundler' by typescript then my all other package will throw error. What is my solution to use datepicker with typescript?

tulsiojha commented 1 day ago

hi @dipbazz, thank you for reporting this issue, I have updated the package with commit a22c8f9dc7e5ffebf4fa72aa7d85fae8d7e550e7.

Please try clean installing the updated package v1.1.1.