Skip to content

Commit

Permalink
feat: export plugin metadata (#8331)
Browse files Browse the repository at this point in the history
* feat: export plugin metadata

* Update Config.ts
  • Loading branch information
bradzacher authored Feb 3, 2024
1 parent 4d94bd2 commit e3d9657
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import type { Linter } from '@typescript-eslint/utils/ts-eslint';

import configRule from './rules/config';

// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
const { name, version } = require('../package.json') as {
name: string;
version: string;
};

export const meta: Linter.PluginMeta = {
name,
version,
};

/**
* Expose a single rule called "config", which will be accessed in the user's eslint config files
* via "tslint/config"
*/
export const rules = {
export const rules: Linter.PluginRules = {
config: configRule,
};

0 comments on commit e3d9657

Please sign in to comment.