Skip to content

Relative stdin-filename breaks my plugin #58

@benmosher

Description

@benmosher

Hello,

I do some relative file path resolution in my plugin (benmosher/eslint-plugin-import) to statically analyze ES2015 import syntax.

Recent changes to send a relative file path via --stdin-filename breaks this resolution. I attempted to use path.join(process.cwd(), context.getFilename()) but the relative path is not relative to the eslint working directory.

It is not clear to me why the relative path change was made in linter.py, so I don't know what the next step is. I'd like to be more robust about paths within my plugin, but in general, running eslint directly seems to provide the absolute path via context.getFilename().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions