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

CLI support for multiple files #455

Open
benmonro opened this issue Aug 20, 2019 · 2 comments
Open

CLI support for multiple files #455

benmonro opened this issue Aug 20, 2019 · 2 comments

Comments

@benmonro
Copy link

trying to use stylint with lint-staged. would be nice if the CLI would accept multiple file paths as a parameter. I think it's currently ignoring anything after the first file that i pass it.

ex:

npx stylint path/to/a.styl path/to/other/b.styl path/to/thing/c.styl

@bratva
Copy link

bratva commented Dec 30, 2019

Some cli, for example lint-staged, expect this behavior by default, but stylint don't support this.

@benmonro
Copy link
Author

@bratva i was able to accomplish the desired result using a lint-staged.config.js file and the following:

module.exports = {
    '*.styl': (files) => files.map(file => `npx stylint ${file}`),
    '*.{js,jsx,snap}': (files) => {
        const filenames = files.join(' ');
        const tasks = ['eslint --fix', 'git add'];

        return tasks.map(task => `${task} ${filenames}`);
    }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants