This project is designed to enable the JSDoc @throws type-checking and documentation-enforcement rules provided by eslint-plugin-explicit-exceptions to be used with frequently used functions and libraries.
# For @types/*, i.e. @types/node
npm install --save-dev @types-with-exceptions/node
# For built-in lib replacement
npm install --save-dev @types-with-exceptions/libWarning
pnpm requires following line to .npmrc file:
public-hoist-pattern[]=@typescript/*
tsconfig.json
 {
    // ...
+   "typeRoots": [
+     "node_modules/@types",
+     "node_modules/@types-with-exceptions"
+   ],
+   "libReplacement": true,
    // ...
 }You can either open an issue to request work or create a PR with your changes.
To open an issue: Click New issue, then include the target package name and example code in your issue.
To submit a PR: Follow the steps below.
- Fork repository
- Check if the package you want to modify exists in the typesdirectory.- If it does not exist, add the desired package to the registry.yamlfile.
- Run pnpm run syncto apply the changes.
 
- If it does not exist, add the desired package to the 
- Modify the relevant *.d.tsfile(s) in thetypesdirectory and commit.
- (Optional) Add tests in the testsdirectory. Refer to rule-tester.
- Create a PR.
# Simplified
node: 'npm:@types/node'
# ^1   ^2  ^3
# 1: The top-level key is used as the package name. For instance, `node` becomes `@types-with-exceptions/node`
# 2: Specifies where to fetch the package from. (Currently, only npm is supported.)
# 3: Package name
# Advanced
lib-es5:
  from: 'npm:typescript'
  #     ^1
  copy:
    'index.d.ts': 'lib/lib.es5.d.ts'
    # ^2          ^3
# 1: Same as simplified version above
# 2: Destination file path
# 3: Source file path
# And to comply with the license, README, LICENSE, etc. are copied by default without needing to specify them separately.