AriPerkkio / eslint-remote-tester-run-action

Github action for running eslint-remote-tester and receiving results in Github issue
1 stars 1 forks source link

feat: support config file as typescript #22

Closed AriPerkkio closed 2 years ago

AriPerkkio commented 2 years ago

Add support for https://github.com/AriPerkkio/eslint-remote-tester/issues/318.

Configuration file name is read from Action arguments:

https://github.com/AriPerkkio/eslint-remote-tester-run-action/blob/223700ccc8394c4e17d54e0d9d5d43dba8fed06c/src/index.ts#L17-L20

User's configuration file is extended by internal configuration:

https://github.com/AriPerkkio/eslint-remote-tester-run-action/blob/223700ccc8394c4e17d54e0d9d5d43dba8fed06c/src/run-tester.ts#L68-L72

We might want to have CONFIGURATION_TEMPLATEs for Javascript and Typescript separately:

https://github.com/AriPerkkio/eslint-remote-tester-run-action/blob/223700ccc8394c4e17d54e0d9d5d43dba8fed06c/src/run-tester.ts#L23-L33

    // Write eslint-remote-tester configuration file
    fs.writeFileSync(
        INTERNAL_CONFIG,
-       CONFIGURATION_TEMPLATE(usersConfigLocation)
+       usersConfigLocation.endsWith('.js') ? 
+           CONFIGURATION_TEMPLATE_JS(usersConfigLocation) :
+           CONFIGURATION_TEMPLATE_TS(usersConfigLocation)
    );