refactor: migrate `eslint-plugin-next` to typescript (#41046)
In #38647, @balazsorban44 has migrated the rule `no-img-element` to typescript. The PR follows #38647 by migrating the entire `eslint-plugin-next` to use typescript. Note it is still possible to write new rules in javascript. The PR does the following things: - Migrates all `utils` to typescript - All previous JSDoc are also converted to the type definitions - Creates a utility method `defineRule` - This is a stub function to provide the type check ability. - With the `defineRule` we don't have to tediously import type definition `Rule.RuleMetaData` and `Rule.RuleModule['create']` from `eslint` anymore, `defineRule` will provide auto-complete and typechecking for `meta` and `create`. - Migrates all rules to typescript - Extra type guards are also added to make typescript happy. All existing `eslint-config-next` unit test cases passed after the migration.
Showing
Please
register
or
sign in
to comment