AriPerkkio / eslint-remote-tester

CLI tool for testing given ESlint rules against multiple repositories at once.

Home Page:https://www.npmjs.com/package/eslint-remote-tester

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: support config file as typescript

AriPerkkio opened this issue · comments

@AriPerkkio since the codebase is now in TypeScript (so there are type definitions) would you be open to supporting eslint-remote-tester.config.ts using ts-node similar to how it's done in Webpack & Jest (among others)?
I'm happy to have a go at implementing if you are (I've done it in a few projects now - it's typically a pretty straightforward & small diff)

Originally posted by @G-Rath in #89 (comment)

This change is welcome @G-Rath! I've recently seen these typescript config files with rollup.config.ts and it improved developer experience a lot.

I think this is the spot where current eslint-remote-tester.config.js is read using require statement.

const configFileContents = require(path.resolve(CONFIGURATION_FILE));
const config = getConfigWithDefaults(configFileContents);
export default config;

Some dependent projects are still plain Javascript code bases so it is important to be backwards compatible with those ones. Maybe ts-node could be run only when extension is .ts? I'm not familiar with implementation of this kind of support.

I'm happy to help if you run into any issues.

Released in 2.1.0.