Skip to content

Commit 7437836

Browse files
authored
♻️ Refactor for Node20 support (#118)
1 parent c7fc536 commit 7437836

18 files changed

+24651
-4030
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.json

-21
This file was deleted.

.github/codeql/codeql-config.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: 'CodeQL config'
2+
3+
queries:
4+
- uses: security-extended
5+
6+
paths:
7+
- src
8+
paths-ignore:
9+
- 'dist/**/*'
10+
- '**/*.test.js'

.github/husky/.gitignore

-1
This file was deleted.

.github/husky/pre-commit

-11
This file was deleted.

.github/workflows/codeql.yml

+10-28
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,33 @@
11
name: CodeQL
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
paths-ignore:
8-
- '*.md'
94
pull_request:
10-
branches:
11-
- main
12-
paths-ignore:
13-
- '*.md'
5+
paths:
6+
- '*/*.js'
7+
- '.github/workflows/codeql.yml'
148

159
jobs:
1610
codeql:
1711
runs-on: ubuntu-latest
1812

19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
21-
cancel-in-progress: true
22-
2313
permissions:
2414
actions: read
2515
contents: read
2616
security-events: write
2717

28-
env:
29-
CI: true
30-
LGTM_INDEX_FILTERS: |
31-
exclude:*/dist/*
32-
3318
strategy:
19+
fail-fast: false
3420
matrix:
35-
language:
36-
- javascript
21+
language: ['javascript']
3722

3823
steps:
39-
- name: Checkout
40-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
24+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
4125

42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@592977e6ae857384aa79bb31e7a1d62d63449ec5
26+
- uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
4427
with:
28+
config-file: ./.github/codeql/codeql-config.yml
4529
languages: ${{ matrix.language }}
4630

47-
- name: Autobuild
48-
uses: github/codeql-action/autobuild@592977e6ae857384aa79bb31e7a1d62d63449ec5
31+
- uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
4932

50-
- name: Perform CodeQL Analysis
51-
uses: github/codeql-action/analyze@592977e6ae857384aa79bb31e7a1d62d63449ec5
33+
- uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
if: ${{ github.event_name == 'pull_request' }}
4848

4949
- name: Setup Node.js v${{ matrix.node-version }}
50-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
50+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
5151
with:
5252
node-version: ${{ matrix.node-version }}
5353
cache: 'npm'

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
[ -n "$CI" ] && exit 0
4+
5+
npx lint-staged --verbose --allow-empty
6+
echo ""

.github/husky/pre-push renamed to .husky/pre-push

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
[ -n "$CI" ] && exit 0
44

5-
. "$(dirname "$0")/_/husky.sh"
6-
75
if [[ $(git status --porcelain -s) != "" ]]; then
86
echo "\n😵 Uncommitted changes found 😵"
97
echo "Please \`git add\` and \`git commit\` or \`git stash -u\` them before pushing!\n"

.prettierignore

-3
This file was deleted.

.prettierrc.js

-1
This file was deleted.

dist/index.js

+20,696-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.js

+2,159-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import globals from 'globals'
2+
import markdown from 'eslint-plugin-markdown'
3+
import prettierConfig from 'eslint-config-prettier'
4+
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended'
5+
6+
export default [
7+
prettierConfig,
8+
prettierPluginRecommended,
9+
{
10+
files: ['*.js'],
11+
ignores: ['build/', 'cache/', 'coverage/', 'dist/', 'node_modules/'],
12+
languageOptions: {
13+
globals: {
14+
...globals.node,
15+
},
16+
parserOptions: {ecmaVersion: 'latest', sourceType: 'module'},
17+
},
18+
plugins: {markdown},
19+
rules: {
20+
'prettier/prettier': 'error',
21+
},
22+
},
23+
...markdown.configs.recommended,
24+
{
25+
files: ['**/*.md'],
26+
processor: 'markdown/markdown',
27+
},
28+
{
29+
files: ['**/*.md/*.js'],
30+
rules: {},
31+
},
32+
]

0 commit comments

Comments
 (0)