Skip to content

Commit

Permalink
♻️ Refactor for Node20 support
Browse files Browse the repository at this point in the history
  • Loading branch information
stoe committed Oct 1, 2024
1 parent c7fc536 commit d590450
Show file tree
Hide file tree
Showing 18 changed files with 24,651 additions and 4,030 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

21 changes: 0 additions & 21 deletions .eslintrc.json

This file was deleted.

10 changes: 10 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'CodeQL config'

queries:
- uses: security-extended

paths:
- src
paths-ignore:
- 'dist/**/*'
- '**/*.test.js'
1 change: 0 additions & 1 deletion .github/husky/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions .github/husky/pre-commit

This file was deleted.

38 changes: 10 additions & 28 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
name: CodeQL

on:
push:
branches:
- main
paths-ignore:
- '*.md'
pull_request:
branches:
- main
paths-ignore:
- '*.md'
paths:
- '*/*.js'
- '.github/workflows/codeql.yml'

jobs:
codeql:
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read
contents: read
security-events: write

env:
CI: true
LGTM_INDEX_FILTERS: |
exclude:*/dist/*
strategy:
fail-fast: false
matrix:
language:
- javascript
language: ['javascript']

steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Initialize CodeQL
uses: github/codeql-action/init@592977e6ae857384aa79bb31e7a1d62d63449ec5
- uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@592977e6ae857384aa79bb31e7a1d62d63449ec5
- uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@592977e6ae857384aa79bb31e7a1d62d63449ec5
- uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}

- name: Setup Node.js v${{ matrix.node-version }}
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand Down
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

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

npx lint-staged --verbose --allow-empty
echo ""
2 changes: 0 additions & 2 deletions .github/husky/pre-push → .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

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

. "$(dirname "$0")/_/husky.sh"

if [[ $(git status --porcelain -s) != "" ]]; then
echo "\n😵 Uncommitted changes found 😵"
echo "Please \`git add\` and \`git commit\` or \`git stash -u\` them before pushing!\n"
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

20,700 changes: 20,696 additions & 4 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2,160 changes: 2,159 additions & 1 deletion dist/sourcemap-register.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import globals from 'globals'
import markdown from 'eslint-plugin-markdown'
import prettierConfig from 'eslint-config-prettier'
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended'

export default [
prettierConfig,
prettierPluginRecommended,
{
files: ['*.js'],
ignores: ['build/', 'cache/', 'coverage/', 'dist/', 'node_modules/'],
languageOptions: {
globals: {
...globals.node,
},
parserOptions: {ecmaVersion: 'latest', sourceType: 'module'},
},
plugins: {markdown},
rules: {
'prettier/prettier': 'error',
},
},
...markdown.configs.recommended,
{
files: ['**/*.md'],
processor: 'markdown/markdown',
},
{
files: ['**/*.md/*.js'],
rules: {},
},
]
Loading

0 comments on commit d590450

Please sign in to comment.