Skip to content

Commit

Permalink
chore: fix sarif script
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Nov 6, 2023
1 parent 70c8e99 commit db3c41a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Run ESLint
run: pnpm run lint
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
run: pnpm run lint:sarif
continue-on-error: true

- name: Upload analysis results to GitHub
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ webpack/
testing/
.idea/
lib/
eslint-results.sarif
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ scripts/
static/
docs/
src/
eslint-results.sarif

# NPM ignore
.eslintrc.json
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"changelog": "tsx scripts/changelog",
"docs": "typedoc --json .tmp/typedoc-out.json --excludeExternals --plugin typedoc-plugin-as-member-of && tsx scripts/docs",
"lint": "eslint --ext .ts ./src",
"lint:sarif": "eslint --ext .ts ./src -f @microsoft/sarif -o eslint-results.sarif --quiet",
"lint:fix": "eslint --ext .ts ./src --fix",
"test": "mocha -r tsx --extension ts 'test/**/*.ts'",
"gpr": "tsx scripts/gpr",
Expand Down Expand Up @@ -78,6 +79,7 @@
"chai-as-promised": "^7.1.1",
"chai-nock": "^1.3.0",
"colors": "1.4.0",
"cross-env": "^7.0.3",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions scripts/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ arr = futureChangelog
: line
);

// eslint-disable-next-line no-useless-escape
const lastVersion = ([...arr].reverse()[1].match(/\[([^\][]*)]/) || [])[0].replace(/[[\]']+/g, '');
const lastVersion = ([...arr].reverse()[1].match(/\[([^\][]*)]/) || [])[0]!.replace(/[[\]']+/g, '');
if (!lastVersion) throw new Error("Can't find last version in changelog.");

const lastLine = `[${currentVersion}]: https://github.com/Snazzah/slash-create/compare/v${lastVersion}...v${currentVersion}`;
Expand Down

0 comments on commit db3c41a

Please sign in to comment.