ui_migration lint(style) Add LINT and PURGE to CSS LESS all over WEBAPP
This commit is contained in:
parent
fb539e9e8e
commit
72345622e5
4 changed files with 1599 additions and 3 deletions
1560
webapp/package-lock.json
generated
1560
webapp/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -28,6 +28,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.28.5",
|
||||
"@fullhuman/postcss-purgecss": "^8.0.0",
|
||||
"@vitejs/plugin-vue": "^6.0.6",
|
||||
"@vue/eslint-config-prettier": "9.0.0",
|
||||
"autoprefixer": "^10.4.24",
|
||||
|
|
@ -38,7 +39,11 @@
|
|||
"eslint-plugin-vue": "^9.20.0",
|
||||
"less": "^4.5.1",
|
||||
"material-symbols": "^0.39.1",
|
||||
"postcss-html": "^1.8.1",
|
||||
"postcss-less": "^6.0.0",
|
||||
"prettier": "^3.2.8",
|
||||
"stylelint": "^17.11.0",
|
||||
"stylelint-config-standard": "^40.0.0",
|
||||
"typescript-eslint": "^8.59.0",
|
||||
"vite": "^7.3.1"
|
||||
},
|
||||
|
|
|
|||
23
webapp/stylelint.config.mjs
Normal file
23
webapp/stylelint.config.mjs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// stylelint.config.mjs
|
||||
export default {
|
||||
extends: ["stylelint-config-standard"],
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ["**/*.vue"],
|
||||
customSyntax: "postcss-html",
|
||||
},
|
||||
{
|
||||
files: ["**/*.less"],
|
||||
customSyntax: "postcss-less",
|
||||
},
|
||||
],
|
||||
|
||||
rules: {
|
||||
// UIKit class naming doesn't match Stylelint's default class pattern
|
||||
"selector-class-pattern": null,
|
||||
// Less @import is fine
|
||||
"no-invalid-position-at-import-rule": null,
|
||||
"no-empty-source": null,
|
||||
},
|
||||
};
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
import { fileURLToPath, URL } from "node:url";
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import purgecss from '@fullhuman/postcss-purgecss';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
|
|
@ -57,5 +58,18 @@ export default defineConfig({
|
|||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
postcss: {
|
||||
plugins: [
|
||||
purgecss({
|
||||
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
||||
safelist: {
|
||||
standard: ['html', 'body'], // Keep basic HTML elements
|
||||
greedy: [ // greedy works by matching patterns, so we can keep all classes starting with 'uk-' for UIkit
|
||||
/^uk-/, // Keep all classes starting with 'uk-' (UIkit)
|
||||
]
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue