Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to skip running lintTextSync for ignored files #227

Open
segrey opened this issue Nov 5, 2019 · 0 comments
Open

Ability to skip running lintTextSync for ignored files #227

segrey opened this issue Nov 5, 2019 · 0 comments

Comments

@segrey
Copy link

segrey commented Nov 5, 2019

What version of this package are you using?
14.3.1

What problem do you want to solve?

Standard provides results = standard.lintTextSync(text, [opts]) API. This is a convenient way for tools to interact with the linter, because there is no need to save a file to disk.
The problem is that this method doesn't check if the passed opts.filename is ignored. Also there is no dedicated method in API to check if a file is ignored.

For example, ESLint provides both CLIEngine#executeOnText() and CLIEngine#isPathIgnored().

What do you think is the correct solution to this problem?

A possible way is to mimic ESLint API and provide standard.isPathIgnored(filename, [opts])
where opts is the same as for standard.lintFiles(files, [opts], callback), i.e. opts.ignore is supported.
Or extend results = standard.lintTextSync(text, [opts]) API to support opts.ignore: no linting if opts.filename is matched by opts.ignore.

@feross feross transferred this issue from standard/standard Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants