wikimedia/grunt-stylelint

Windows output file characters problem

slolo2000 opened this issue · 3 comments

Hello,

I have a problem with grunt-stylelint and outfile formatting.

Here is what I have to the standard output (Node.js command prompt):

337:2 × Expected indentation of 2 spaces indentation
338:2 × Expected indentation of 2 spaces indentation
339:2 × Expected "overflow" to come before "white-space" order/properties-order
345:14 × Expected "#F0F0F0" to be "#f0f0f0" color-hex-case
348:2 × Expected indentation of 2 spaces indentation
348:15 × Expected numeric font-weight notation font-weight-notation
367:17 × Unexpected unit length-zero-no-unit

✖ 10 problems

And here is what I have in my output text file:

�[2m337:2�[22m �[31m�[31m�[31m�[39m Expected indentation of 2 spaces �[2mindentation�[22m
�[2m338:2�[22m �[31m�[31m�[31m�[39m Expected indentation of 2 spaces �[2mindentation�[22m
�[2m339:2�[22m �[31m�[31m�[31m�[39m Expected "overflow" to come before "white-space" �[2morder/properties-order�[22m
�[2m345:14�[22m �[31m�[31m�[31m�[39m Expected "#F0F0F0" to be "#f0f0f0" �[2mcolor-hex-case�[22m
�[2m348:2�[22m �[31m�[31m�[31m�[39m Expected indentation of 2 spaces �[2mindentation�[22m
�[2m348:15�[22m �[31m�[31m�[31m�[39m Expected numeric font-weight notation �[2mfont-weight-notation�[22m
�[2m367:17�[22m �[31m�[31m�[31m�[39m Unexpected unit �[2mlength-zero-no-unit�[22m
�[2m367:25�[22m �[31m�[31m�[31m�[39m Unexpected unit �[2mlength-zero-no-unit�[22m

Is there a problem with output file and fortmatting under Windows?

My computer is under Windows 10 build 1803.
My options for stylelint are:

stylelint: {
	options: {
		configFile: '.stylelintrc',
		formatter: 'string',
		ignoreDisables: false,
		failOnError: true,
		outputFile: 'stylelint-report.txt',
		reportNeedlessDisables: false,
		syntax: ''
	},
	src: ['css/**/*.css']
}

Thanks in advance for your help and have a nice day.

edg2s commented

The markers are generated by chalk to add colour. We've updated chalk a few times in the last few years, so this may have been fixed.

edg2s commented

Please re-open if this is still an issue.

Hello,

In fact I have exactly the same problem like before.

I have written more details on my configuration below.

Now my PC configuration is:

  • Windows 10 build 20H2

NodeJS package I used:

    "autoprefixer": "^10.0.2",
    "grunt": "^1.3.0",
    "grunt-contrib-clean": "^2.0.0",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-cssmin": "^3.0.0",
    "grunt-contrib-jshint": "^3.0.0",
    "grunt-contrib-uglify": "^5.0.0",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-eslint": "^23.0.0",
    "grunt-postcss": "0.9.0",
    "grunt-sass": "^3.1.0",
    "grunt-stylelint": "^0.15.0",
    "node-sass": "^5.0.0",
    "postcss": "^8.1.8",
    "stylelint": "^13.8.0",
    "stylelint-config-standard": "^20.0.0"

An extract of my gruntfile.js:

	stylelint: {
		options: {
			configFile: '.stylelintrc',
			formatter: 'string',
			ignoreDisables: false,
			failOnError: true,
			outputFile: 'stylelint-report.txt',
			reportNeedlessDisables: false,
			syntax: ''
		},
			
		todo: {
			src: ['css/**/*.css', '!css/**/*.min.js'],
			filter: function(filepath) {
				return !((/(bootstrap(-theme){0,1}\.css|\.min\.css)$/i).test(filepath));
			  }
		}
	},

The content of my .stylelintrc file:

{
  "extends": ["stylelint-config-standard"],
  "rules": {
    "indentation": "tab"
  }
}

And how I initialize the task in the grunt file:
...
grunt.loadNpmTasks('grunt-stylelint');

grunt.registerTask('check-css', ['stylelint:todo']);

I call it with "grunt check-css"

And below an extract of the generated file:

�[4m../MySite/css/bootstrap-style.css�[24m
�[2m4:24�[22m �[31m�[31m�[39m Expected newline after "," �[2mselector-list-comma-newline-after�[22m

�[4m../MySite/css/style-print.css�[24m
�[2m7:1�[22m �[31m�[31m�[39m Expected empty line before rule �[2mrule-empty-line-before�[22m
�[2m10:1�[22m �[31m�[31m�[39m Expected empty line before rule �[2mrule-empty-line-before�[22m
�[2m13:2�[22m �[31m�[31m�[39m Expected newline after "}" �[2mblock-closing-brace-newline-after�[22m
�[2m13:2�[22m �[31m�[31m�[39m Unexpected whitespace at end of line �[2mno-eol-whitespace�[22m
�[2m14:1�[22m �[31m�[31m�[39m Expected empty line before rule �[2mrule-empty-line-before�[22m
�[2m17:2�[22m �[31m�[31m�[39m Expected newline after "}" �[2mblock-closing-brace-newline-after�[22m
�[2m17:2�[22m �[31m�[31m�[39m Unexpected whitespace at end of line �[2mno-eol-whitespace�[22m
�[2m18:1�[22m �[31m�[31m�[39m Expected empty line before rule �[2mrule-empty-line-before�[22m
�[2m21:1�[22m �[31m�[31m�[39m Expected empty line before rule �[2mrule-empty-line-before�[22m
�[2m21:11�[22m �[31m�[31m�[39m Expected newline after "{" of a multi-line block �[2mblock-opening-brace-newline-after�[22m
�[2m21:22�[22m �[31m�[31m�[39m Unexpected whitespace at end of line �[2mno-eol-whitespace�[22m
�[2m22: