Skip to content

Making it Windows compatibleΒ #466

@artola

Description

@artola

We found that this library works well in posix (Mac, Unix or using WSL) but it fails when we run it on Windows win32.

There are a few places that are "sensible" to the path separator (i.e., / or \\).

It would be great to enhance it to work seamlessly. If you agree I will create a PR with such changes, here some details:

The function isParserModuleNameValid is looking for the existence of parserModuleName, it is used only once as:

isParserModuleNameValid(configFileContent.parser, "@typescript-eslint/parser")

the module could be made system sensible using path.join('@typescript-eslint', 'parser').

const p = require.resolve(parserModuleSpecifier);

if (!isParserModuleNameValid(configFileContent.parser, "@typescript-eslint/parser")) {

Something similar around these lines:

const fragments = require.resolve("eslint").split("node_modules/eslint");

We can fix it using:

      const fragments = require.resolve("eslint").split(path.join("node_modules", "eslint"));
      path.join(...fragments.slice(0, fragments.length - 1), "node_modules", "eslint", "conf", `${name}.js`);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions