From 3802d182041480dbba502037966421faf6936e6c Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sat, 15 Feb 2025 00:23:46 +0100 Subject: [PATCH] Use Stylelint directly --- .github/CONTRIBUTING.md | 2 ++ .github/workflows/coding-standards.yml | 3 +++ GNUmakefile | 3 +++ package.json | 4 ++-- webpack.config.js | 10 +--------- yarn.lock | 11 ----------- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b9895858c..ba7a88646 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -57,3 +57,5 @@ To run the PHP formatter run `make fix-cs`. To run the PHPStan static analysis run `make phpstan`. To run the JS linter run `make lint-js`. + +To run the SCSS linter run `make lint-scss`. diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ec4bb2eba..23d992ea0 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -73,3 +73,6 @@ jobs: - name: "Run ESLint" run: "yarn lint:js" + + - name: "Run Stylelint" + run: "yarn lint:scss" diff --git a/GNUmakefile b/GNUmakefile index 365d7ddef..acac43dd4 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -55,6 +55,9 @@ phpstan: ## Run PHPStan lint-js: ## Run ESLint @$(YARN) lint:js +lint-scss: ## Run Stylelint + @$(YARN) lint:scss + release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). ifndef VERSION $(error VERSION is not set) diff --git a/package.json b/package.json index 495f18d71..ed87e8ee1 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "stylelint-config-standard": "^34.0.0", "stylelint-config-standard-scss": "^11.1.0", "stylelint-scss": "^5.3.2", - "stylelint-webpack-plugin": "^5.0.1", "terser-webpack-plugin": "^5.3.11", "url-loader": "^4.1.1", "webpack": "^5.98.0", @@ -103,6 +102,7 @@ "build:dev": "encore dev", "watch": "encore dev --watch", "build:prod": "encore production --progress", - "lint:js": "eslint assets/*.js assets/js/*.js assets/js/**/*.js" + "lint:js": "eslint assets/*.js assets/js/*.js assets/js/**/*.js", + "lint:scss": "stylelint assets/scss/*.scss assets/scss/**/*.scss" } } diff --git a/webpack.config.js b/webpack.config.js index 56bff7fcf..80358deaa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,4 @@ const Encore = require('@symfony/webpack-encore'); -const StyleLintPlugin = require('stylelint-webpack-plugin'); if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); @@ -23,13 +22,6 @@ Encore }) .enableSassLoader() .enablePostCssLoader() - .autoProvidejQuery() - .addPlugin(new StyleLintPlugin({ - configFile: 'stylelint.config.js', - failOnError: false, - quiet: false, - context: 'assets', - files: '**/*.scss', - })); + .autoProvidejQuery(); module.exports = Encore.getWebpackConfig(); diff --git a/yarn.lock b/yarn.lock index d627c5f31..58233eba6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6221,17 +6221,6 @@ stylelint-scss@^5.3.0, stylelint-scss@^5.3.2: postcss-selector-parser "^6.0.13" postcss-value-parser "^4.2.0" -stylelint-webpack-plugin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/stylelint-webpack-plugin/-/stylelint-webpack-plugin-5.0.1.tgz#13a7589a8d4cc00b155b9f792876334ca0bcaf71" - integrity sha512-07lpo1uVoFctKv0EOOg/YSrUppcLMjNBSMRqgooNnlbfAOgQfMzvLK+EbXz0HQiEgZobr+XQX9md/TgwTGdzbw== - dependencies: - globby "^11.1.0" - jest-worker "^29.7.0" - micromatch "^4.0.5" - normalize-path "^3.0.0" - schema-utils "^4.2.0" - stylelint@^15.11.0: version "15.11.0" resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.11.0.tgz#3ff8466f5f5c47362bc7c8c9d382741c58bc3292"