Skip to content

Commit

Permalink
feat: add types to package
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Nov 5, 2024
1 parent 2a12174 commit 1bdda54
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,11 @@ module.exports = {
'import/no-commonjs': 'off',
},
},
{
files: ['*.d.ts'],
rules: {
strict: 'off',
},
},
],
};
28 changes: 28 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Linter, Rule } from 'eslint';

declare const plugin: {
meta: {
name: string;
version: string;
};
environments: {
globals: {
globals: {
[key: string]: boolean;
};
};
};
configs: {
all: Linter.LegacyConfig;
recommended: Linter.LegacyConfig;
style: Linter.LegacyConfig;
'flat/all': Linter.FlatConfig;
'flat/recommended': Linter.FlatConfig;
'flat/style': Linter.FlatConfig;
};
rules: {
[key: string]: Rule.RuleModule;
};
};

export = plugin;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"url": "jkimbo.com"
},
"main": "lib/index.js",
"types": "index.d.ts",
"files": [
"docs/",
"lib/"
"lib/",
"index.d.ts"
],
"scripts": {
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf --glob lib/__tests__ 'lib/**/__tests__'",
Expand Down

0 comments on commit 1bdda54

Please sign in to comment.