diff --git a/.prettierignore b/.prettierignore index d2b4451e9e..13158ed8ac 100644 --- a/.prettierignore +++ b/.prettierignore @@ -19,3 +19,7 @@ Icon? Thumbs.db *~ *.swp + +# Test files +plugins/*/expected/*.css +plugins/*/fixtures/*.css diff --git a/.stylelintignore b/.stylelintignore index 37b50812e9..abcf328da0 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -8,5 +8,7 @@ dist *-generated.css node_modules/**/*.css -plugins/*/expected/* -plugins/*/fixtures/* \ No newline at end of file + +# Test files +plugins/*/expected/*.css +plugins/*/fixtures/*.css diff --git a/lint-staged.config.js b/lint-staged.config.js index 358bbfa8d8..9f9e2a6dad 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,20 +1,21 @@ module.exports = { - "*.css,!plugins/*/{expected,fixtures}/*.css": [ - "prettier --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write", + "*.css": [ + "stylelint --fix --cache --allow-empty-input --report-descriptionless-disables --report-invalid-scope-disables --report-needless-disables", + "prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write --config .prettierrc", ], "*.{js,json}": [ "eslint --fix --cache --no-error-on-unmatched-pattern --quiet --ignore-pattern \"!.storybook/\"" ], "dist/*.css": [ - "prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write" + "prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write --config .prettierrc" ], "components/*/metadata/metadata.json": (files) => { return [ ...(files.map(file => `pajv test --valid -s ./schemas/metadata.schema.json -d "${file}"`) ?? []), - `prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write ${files.join(" ")}` + `prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write ${files.join(" ")} --config .prettierrc` ]; }, "*.{md,mdx}": [ - "prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write" + "prettier --no-config --no-error-on-unmatched-pattern --ignore-unknown --log-level silent --write --config .prettierrc" ] }; diff --git a/package.json b/package.json index b69adbce8d..5c893a851c 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "gh-pages": "^6.2.0", "husky": "^9.1.7", "jsonc-eslint-parser": "^2.4.0", - "lint-staged": "^15.2.11", + "lint-staged": "^15.3.0", "lodash": "^4.17.21", "node-gyp": "^10.1.0", "npm-registry-fetch": "^18.0.2", diff --git a/yarn.lock b/yarn.lock index 649820c8e4..12126c0fe4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6695,13 +6695,20 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^5.3.0, chalk@npm:~5.3.0": +"chalk@npm:^5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" checksum: 10c0/8297d436b2c0f95801103ff2ef67268d362021b8210daf8ddbe349695333eb3610a71122172ff3b0272f1ef2cf7cc2c41fdaa4715f52e49ffe04c56340feed09 languageName: node linkType: hard +"chalk@npm:~5.4.1": + version: 5.4.1 + resolution: "chalk@npm:5.4.1" + checksum: 10c0/b23e88132c702f4855ca6d25cb5538b1114343e41472d5263ee8a37cccfccd9c4216d111e1097c6a27830407a1dc81fecdf2a56f2c63033d4dbbd88c10b0dcef + languageName: node + linkType: hard + "change-case@npm:^4.1.2": version: 4.1.2 resolution: "change-case@npm:4.1.2" @@ -11459,11 +11466,11 @@ __metadata: languageName: node linkType: hard -"lint-staged@npm:^15.2.11": - version: 15.2.11 - resolution: "lint-staged@npm:15.2.11" +"lint-staged@npm:^15.3.0": + version: 15.3.0 + resolution: "lint-staged@npm:15.3.0" dependencies: - chalk: "npm:~5.3.0" + chalk: "npm:~5.4.1" commander: "npm:~12.1.0" debug: "npm:~4.4.0" execa: "npm:~8.0.1" @@ -11475,7 +11482,7 @@ __metadata: yaml: "npm:~2.6.1" bin: lint-staged: bin/lint-staged.js - checksum: 10c0/28e2ad08b90460cc18398a023eaf93954d7753f958c2b889ead2d9305407d7b4ef0ee007875410d6ce1df758007fda77e079c82eb79c9ce684fba71e6f7d0452 + checksum: 10c0/1ddf9488c523c0b65c85b755428d4ad74fac3aa6ccb2e28e9bff5b8d86503158fe241d20d5433a11146872050b43580644901a5ef4c924b1ad7017c224a07339 languageName: node linkType: hard @@ -15678,7 +15685,7 @@ __metadata: gh-pages: "npm:^6.2.0" husky: "npm:^9.1.7" jsonc-eslint-parser: "npm:^2.4.0" - lint-staged: "npm:^15.2.11" + lint-staged: "npm:^15.3.0" lodash: "npm:^4.17.21" node-gyp: "npm:^10.1.0" npm-registry-fetch: "npm:^18.0.2"