Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PowerShell support for svglint script #10733

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/verify.yml
Expand Up @@ -45,7 +45,9 @@ jobs:
- name: Install dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run linter
run: npm run lint --icons='${{ steps.changes.outputs.icons_files }}'
run: |
sed -i 's/icons\/\*\.svg/$npm_config_icons/' package.json
npm run lint --icons='${{ steps.changes.outputs.icons_files }}'
env:
# Authorise GitHub API requests for editorconfig-checker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
@@ -1,5 +1,5 @@
package-lock=false
save-exact=true

# Icons to lint with SVGLint (see `npm run svglint`)
# Icons to lint with SVGLint on CI (see `lint` step on verify.yml workflow)
icons=icons/*.svg
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -115,7 +115,7 @@
"prettierlint": "prettier --cache --check --ignore-unknown \"**/*.!(js|jsx|mjs|cjs|ts|tsx|mts|cts|svg)\"",
"jslint": "xo",
"jsonlint": "./scripts/lint/jsonlint.js",
"svglint": "svglint --ci $npm_config_icons --config svglint.config.mjs",
"svglint": "svglint --ci --config svglint.config.mjs icons/*.svg",
"wslint": "editorconfig-checker",
"prepare": "husky",
"prepublishOnly": "npm run build",
Expand Down
4 changes: 3 additions & 1 deletion svglint.config.mjs
Expand Up @@ -180,7 +180,7 @@ const ignoreIcon = (linterName, path, $) => {
iconIgnored[linterName][path] = iconName;
};

export const config = {
Copy link
Member Author

@mondeja mondeja Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This silent pass error will be prevented to happen again by simple-icons/svglint#96

const config = {
rules: {
elm: {
svg: 1,
Expand Down Expand Up @@ -1023,3 +1023,5 @@ export const config = {
],
},
};

export default config;