Skip to content

Autodiscovery of *.js configs #97

@kachkaev

Description

@kachkaev

I’m working on creating @company/markdownlint-config and have a question about this statement in the docs:

JS configuration files must be provided via the --config argument; they are not automatically loaded because running untrusted code is a security concern.

Given this limitation, it’s unclear how to keep the CLI config in sync with the editor integration (e.g. the VSCode one). Tools like Prettier and ESlint autoload *.js configs and it not a security concern for them. Because CLI does this, so can the editor.

Meanwhile, creating a custom package with the config and referring to it in a js files is problematic. While it is possible to feed this ‘unsafe’ file to CLI via --config, the editor won’t see this and will report wrong problems as you type. Ideally, I’d like to allow users of a shared config to just do this:

// .markdownlint.js
module.exports = require("@company/markdownlint-config")

Could .js files be made autodiscoverable too? I understand that theoretically this is a security hole of some sort, but the experience of other tools suggests that it’s fine in practice.

cc @alejandroclaro (author of #85) and @DavidAnson (author of a1f9a15)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions