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

Disable --fix while using a processor and display message #3873

Merged
merged 2 commits into from
Jan 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/getPostcssResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,15 @@ module.exports = function(
const source = options.code ? options.codeFilename : options.filePath;
let preProcessedCode = code;

if (options.codeProcessors) {
if (options.codeProcessors && options.codeProcessors.length) {
if (stylelint._options.fix) {
// eslint-disable-next-line no-console
console.warn(
"Autofix is incompatible with processors and will be disabled. Are you sure you need a processor?"
);
stylelint._options.fix = false;
}

options.codeProcessors.forEach(codeProcessor => {
preProcessedCode = codeProcessor(preProcessedCode, source);
});
Expand Down