Skip to content

Commit e3d9657

Browse files
authored
feat: export plugin metadata (#8331)
* feat: export plugin metadata * Update Config.ts
1 parent 4d94bd2 commit e3d9657

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: src/index.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
import type { Linter } from '@typescript-eslint/utils/ts-eslint';
2+
13
import configRule from './rules/config';
24

5+
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
6+
const { name, version } = require('../package.json') as {
7+
name: string;
8+
version: string;
9+
};
10+
11+
export const meta: Linter.PluginMeta = {
12+
name,
13+
version,
14+
};
15+
316
/**
417
* Expose a single rule called "config", which will be accessed in the user's eslint config files
518
* via "tslint/config"
619
*/
7-
export const rules = {
20+
export const rules: Linter.PluginRules = {
821
config: configRule,
922
};

0 commit comments

Comments
 (0)