Skip to content

Commit

Permalink
Add typescript declaration file to package.json (#56)
Browse files Browse the repository at this point in the history
* Add typescript declaration file to package.json

* chore: update index.type.ts and package.json to use .d.ts files for TypeScript declarations
  • Loading branch information
faner11 authored Apr 15, 2024
1 parent 4f18b5b commit fbc6b69
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
12 changes: 12 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare const _default: {
configs: {
recommended: {
plugins: string[];
rules: Record<string, string>;
};
"flat/recommended": {
rules: Record<string, string>;
};
};
};
export default _default;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
".": {
"import": "./index.js",
"require": "./index.cjs",
"default": "./index.js"
"default": "./index.js",
"types": "./index.d.ts"
},
"./rules": {
"import": "./rules.js",
"require": "./rules.cjs",
"default": "./rules.js"
"default": "./rules.js",
"types": "./rules.d.ts"
}
},
"author": "Dunqing <dengqing0821@gmail.com>",
Expand Down
11 changes: 11 additions & 0 deletions rules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const eslintRules: Record<string, any>;
export const typescriptRules: Record<string, any>;
export const jestRules: Record<string, any>;
export const unicornRules: Record<string, any>;
export const reactRules: Record<string, any>;
export const reactPerfRules: Record<string, any>;
export const importRules: Record<string, any>;
export const jsxA11yRules: Record<string, any>;
export const nextjsRules: Record<string, any>;
export const jsdocRules: Record<string, any>;
export const treeShakingRules: Record<string, any>;

0 comments on commit fbc6b69

Please sign in to comment.