Skip to content

Dependencies #124

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
- name: Install
run: npm install
@@ -34,7 +34,7 @@ jobs:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
- name: Install
run: npm install
@@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18, 20]
node: [18, 20, 22]
steps:
- uses: actions/checkout@v3
with:
@@ -67,31 +67,31 @@ jobs:
run: npm run test:node

test_macos:
name: Test on MacOS with Node 16
name: Test on MacOS with Node 18
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
- name: Install
run: npm install
- name: Run tests
run: npm run test:node

test_windows:
name: Test on Windows with Node 16
name: Test on Windows with Node 18
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
- name: Install
run: npm install
79 changes: 79 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { defineConfig, globalIgnores } from 'eslint/config'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default defineConfig([
globalIgnores(['src/antlr', '**/dist']),
{
extends: compat.extends('eslint:recommended'),

plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.mocha,
...globals.node,
},

parser: tsParser,
},

rules: {
'no-var': 'error',
'object-curly-spacing': ['error', 'always'],
'object-shorthand': 'error',
'prefer-const': 'error',
'max-len': 'off',
},
},
{
files: ['**/*.ts'],

extends: compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
),

plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: ['./tsconfig.json'],
},
},

rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
])
3,304 changes: 1,911 additions & 1,393 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -41,25 +41,28 @@
},
"license": "MIT",
"devDependencies": {
"@types/chai": "^4.3.12",
"@types/mocha": "^10.0.6",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"antlr4": "^4.13.1-patch-1",
"browserslist": "^4.23.0",
"chai": "^4.4.1",
"esbuild": "^0.20.1",
"esbuild-plugin-browserslist": "^0.11.1",
"eslint": "^8.57.0",
"karma": "^6.4.3",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.24.0",
"@types/chai": "^4.3.20",
"@types/mocha": "^10.0.10",
"@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.30.1",
"antlr4": "^4.13.2",
"browserslist": "^4.24.4",
"chai": "^4.5.0",
"esbuild": "^0.25.2",
"esbuild-plugin-browserslist": "^0.16.0",
"eslint": "^9.24.0",
"globals": "^16.0.0",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-mocha": "^2.0.1",
"mocha": "^10.3.0",
"nyc": "^15.1.0",
"prettier": "^3.2.5",
"puppeteer": "^22.4.1",
"mocha": "^11.1.0",
"nyc": "^17.1.0",
"prettier": "^3.5.3",
"puppeteer": "^24.6.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
"typescript": "^5.8.3"
},
"nyc": {
"extension": [
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
@@ -144,6 +144,6 @@ export function visit(
const selector = (node.type + ':exit') as `${ASTNodeTypeString}:exit`
if (visitor[selector] !== undefined) {
// TODO can we avoid this `as never`
visitor[selector]!(node as never, nodeParent)
visitor[selector](node as never, nodeParent)
}
}