diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 449871f7..d72b20c0 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -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 }} diff --git a/.npmrc b/.npmrc index 4e8c3098..a8bc1a11 100644 --- a/.npmrc +++ b/.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 diff --git a/package.json b/package.json index c15e9cef..16df6a2e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/svglint.config.mjs b/svglint.config.mjs index 5386e2b0..3fbd5b1c 100644 --- a/svglint.config.mjs +++ b/svglint.config.mjs @@ -180,7 +180,7 @@ const ignoreIcon = (linterName, path, $) => { iconIgnored[linterName][path] = iconName; }; -export const config = { +const config = { rules: { elm: { svg: 1, @@ -1023,3 +1023,5 @@ export const config = { ], }, }; + +export default config;