diff --git a/package.json b/package.json index 199e40e6d6d..864cdff484c 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "chalk": "^4.1.0", "coveralls": "^3.1.0", "date-fns": "^2.30.0", - "eslint": "^7.19.0", + "eslint": "^8.57.0", "eslint-config-ckeditor5": "^5.3.0", "fs-extra": "^11.1.1", "glob": "^10.2.5", diff --git a/scripts/eslint-formatter.js b/scripts/eslint-formatter.js index e81bb7b2c63..d3505b43c4c 100644 --- a/scripts/eslint-formatter.js +++ b/scripts/eslint-formatter.js @@ -8,11 +8,12 @@ /* eslint-env node */ // See: https://eslint.org/docs/user-guide/formatters/#stylish. -const eslintStylishFormatter = require( 'eslint/lib/cli-engine/formatters/stylish' ); const chalk = require( 'chalk' ); +const { ESLint } = require( 'eslint' ); // eslint-disable-next-line max-len -const CODE_STYLE_URL = 'https://ckeditor.com/docs/ckeditor5/latest/framework/contributing/code-style.html#ckeditor-5-custom-eslint-rules'; +const CODE_STYLE_URL = + 'https://ckeditor.com/docs/ckeditor5/latest/framework/contributing/code-style.html#ckeditor-5-custom-eslint-rules'; /** * Overwrite the default ESLint formatter. If CKEditor 5 related error occurred, @@ -20,8 +21,11 @@ const CODE_STYLE_URL = 'https://ckeditor.com/docs/ckeditor5/latest/framework/con * * @param {Array} results */ -module.exports = results => { - console.log( eslintStylishFormatter( results ) ); +module.exports = async results => { + const eslint = new ESLint(); + const stylish = await eslint.loadFormatter(); + + console.log( stylish.format( results ) ); const hasCKEditorErrors = results.some( item => { if ( !Array.isArray( item.messages ) ) {