kksandr7 / gulp-stylelint-esm-bug

0 stars 0 forks source link

Test cases with and without your fix #1

Open adorade opened 1 month ago

adorade commented 1 month ago

Test cases with and without your fix, you have the results below.

adorade commented 1 month ago

Good config

import { src, dest, series } from 'gulp';
import gStylelintEsm from 'gulp-stylelint-esm';

function stylelint() {
  return src('fixtures/*.css')
    .pipe(gStylelintEsm({
      failAfterError: true,
      config: { rules: { 'color-hex-length': 'short' } },
      reporters: [{ formatter: 'string', console: true }],
    }));
};

function copy() {
  return src('fixtures/*.css')
    .pipe(dest('dist'));
}

const styles = series(stylelint, copy);

export default styles;

Output, no code modification

NOTE: dist folder not created

# gulp / yarn run gulp
./some-deploy.sh

yarn run v1.22.22
$ gulp
[14:26:30] Using gulpfile /gulp-stylelint-esm-bug/gulpfile.mjs
[14:26:30] Starting 'default'...
[14:26:30] Starting 'stylelint'...
[14:26:30] 

fixtures/invalid.css
  2:10  ✖  Expected "#ffffff" to be "#fff"  color-hex-length

✖ 1 problem (1 error, 0 warnings)
  1 error potentially fixable with the "--fix" option.

[14:26:30] 'stylelint' errored after 147 ms
[14:26:30] Error in plugin "gulp-stylelint-esm"
Message:
    Failed with 1 error
[14:26:30] 'default' errored after 151 ms
error Command failed with exit code 1.

Output, code modification

NOTE: dist folder not created

# gulp / yarn run gulp
./some-deploy.sh

yarn run v1.22.22
$ gulp
[14:28:30] Using gulpfile /gulp-stylelint-esm-bug/gulpfile.mjs
[14:28:30] Starting 'default'...
[14:28:30] Starting 'stylelint'...
[14:28:30] 

fixtures/invalid.css
  2:10  ✖  Expected "#ffffff" to be "#fff"  color-hex-length

✖ 1 problem (1 error, 0 warnings)
  1 error potentially fixable with the "--fix" option.

[14:28:30] 'stylelint' errored after 146 ms
[14:28:30] Error in plugin "gulp-stylelint-esm"
Message:
    Failed with 1 error
[14:28:30] 'default' errored after 153 ms
error Command failed with exit code 1.
adorade commented 1 month ago

Your config

import { src, dest } from 'gulp';
import gStylelintEsm from 'gulp-stylelint-esm';

function stylelint() {
  return src('fixtures/*.css')
    .pipe(gStylelintEsm({
      failAfterError: true,
      config: { rules: { 'color-hex-length': 'short' } },
      reporters: [{ formatter: 'string', console: true }],
    }))
    .pipe(dest('dist'));
};

export default stylelint;

Output, no code modification

NOTE: dist folder created and *.css files copied

# gulp / yarn run gulp
./some-deploy.sh

yarn run v1.22.22
$ gulp
[14:25:30] Using gulpfile /gulp-stylelint-esm-bug/gulpfile.mjs
[14:25:30] Starting 'default'...
[14:25:30] 

fixtures/invalid.css
  2:10  ✖  Expected "#ffffff" to be "#fff"  color-hex-length

✖ 1 problem (1 error, 0 warnings)
  1 error potentially fixable with the "--fix" option.

[14:25:30] Finished 'default' after 247 ms
Done in 1.01s.
Some other commands after successfully running gulp
...
Deployment completed successfully

Output, code modification

NOTE: dist folder created and *.css files copied

# gulp / yarn run gulp
./some-deploy.sh

yarn run v1.22.22
$ gulp
[14:27:30] Using gulpfile /gulp-stylelint-esm-bug/gulpfile.mjs
[14:27:30] Starting 'default'...
[14:27:30] 

fixtures/invalid.css
  2:10  ✖  Expected "#ffffff" to be "#fff"  color-hex-length

✖ 1 problem (1 error, 0 warnings)
  1 error potentially fixable with the "--fix" option.

[14:27:30] The following tasks did not complete: default
Did you forget to signal async completion?
error Command failed with exit code 1.