Skip to content

Commit

Permalink
feat: add TypeScript types (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton authored Nov 5, 2024
1 parent 6f8ff4d commit 1ce1258
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 1ce1258

Please sign in to comment.