Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@ import type {Rule, ESLint} from 'eslint';
import {configFactory as configRecommended} from './configs/recommended.js';
import {config as configLegacyRecommended} from './configs/legacy-recommended.js';
import {rule as banDependencies} from './rules/ban-dependencies.js';
import {readFileSync} from 'node:fs';
import path from 'node:path';

const {name, version} = JSON.parse(
readFileSync(path.resolve(__dirname, '../package.json'), 'utf8')
);

export const rules: Record<string, Rule.RuleModule> = {
'ban-dependencies': banDependencies
};

const plugin: ESLint.Plugin = {rules};
const plugin: ESLint.Plugin = {
meta: {name, version},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if all plugins had this, its probably what ESLint should actually be comparing by 👀

rules
};

export const configs = {
recommended: configLegacyRecommended,
'flat/recommended': configRecommended(plugin)
};

plugin.configs = configs;

export default plugin;