eslint-community / eslint-plugin-eslint-plugin

An ESLint plugin for linting ESLint plugins
MIT License
196 stars 26 forks source link

feat: support named exports in ESM/TS #449

Closed 43081j closed 8 months ago

43081j commented 8 months ago

This adds support for named exports in ESM (whether it be TS or not).

For example:

export const rule: RuleModule = {
  create: () => { ... };
};

Also, exported symbols:

const rule = { ... };

export {rule};

While ESLint plugins are still usually CJS at time of writing this, many are written as ESM sources, and an increasing number are using named exports.

Reviewer notes

You'll want to hide whitespace changes when reviewing this, as prettier reformatted a bunch of it thanks to changing the level of nesting/chaining.

Fixes #375

43081j commented 8 months ago

Thanks for the quick review @bmish , I'll sort the changes tomorrow 👍

43081j commented 8 months ago

FYI i have at least resolved the two changes

not sure what you want to do about the testing. since it seems like @aladdin-add already ran the remote tester successfully

43081j commented 8 months ago

@bmish i ran it against:

and all seemed well