Skip to content

Commit

Permalink
chore: update dependencies (#1139)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* chore: update dependencies

This also includes major version bumps of prettier and eslint, which
triggered some changes.

* added typescript as dev dependency instead of installing globally

* downgrade webpack to fix eslint-scopes type conflict

* fix(ts): add @types/node

See DefinitelyTyped/DefinitelyTyped#70562 (comment)

---------

Co-authored-by: Chris Seufert <[email protected]>
  • Loading branch information
czosel and cseufert authored Nov 8, 2024
1 parent 4d4bda2 commit 7d8c5cc
Show file tree
Hide file tree
Showing 177 changed files with 2,512 additions and 2,223 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,7 +26,6 @@ jobs:
- name: type check
run: |
npm i -g typescript
yarn build-types
[ $(git diff types.d.ts | wc -l) -gt 0 ] && echo 'Diff exists in types.d.ts. Please change jsdoc.' && exit 1
tsc --noEmit types.d.ts
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarpm test
38 changes: 38 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from "@eslint/js";
import jest from "eslint-plugin-jest";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";

export default [
{
ignores: ["dist", "docs", "example", "tutorials"],
},
js.configs.recommended,
{
files: ["test/**"],
...jest.configs["flat/recommended"],
rules: {
...jest.configs["flat/recommended"].rules,
"no-console": "off",
},
languageOptions: {
globals: jest.environments.globals.globals,
},
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
sourceType: "commonjs",
},

rules: {
"prefer-const": "error",
"no-var": "error",
curly: ["error", "multi-line"],
},
},
eslintPluginPrettierRecommended,
];
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,15 @@
"scripts": {
"fix": "eslint . --fix",
"test": "jest",
"husky": "yarpm run test",
"prepublishOnly": "yarpm run build",
"prebuild": "yarpm run test",
"build": "webpack --config webpack.config.js",
"-postbuild": "yarpm run build-docs",
"build-docs": "jsdoc -c .jsdoc.json",
"build-types": "jsdoc -t node_modules/tsd-jsdoc/dist -r src -d . && prettier -w types.d.ts",
"publish-docs": "git subtree push --prefix docs origin gh-pages",
"benchmark": "node test/benchmark.js"
},
"husky": {
"hooks": {
"pre-commit": "yarpm run husky"
}
"benchmark": "node test/benchmark.js",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -62,24 +57,30 @@
],
"license": "BSD-3-Clause",
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"babel-loader": "^9.1.2",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@types/node": "^22.9.0",
"babel-loader": "^9.2.1",
"benchmark": "^2.1.4",
"coveralls": "^3.0.3",
"eslint": "^8.36.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest-runner-eslint": "^2.0.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"husky": "^9.1.6",
"jest": "^29.7.0",
"jest-runner-eslint": "^2.2.1",
"jsdoc": "^3.6.11",
"jsdoc-template": "^1.2.0",
"lodash.template": ">=4.5.0",
"prettier": "^2.8.6",
"prettier": "^3.3.3",
"tsd-jsdoc": "^2.5.0",
"webpack": "^5.76.2",
"webpack-cli": "^5.0.1",
"typescript": "^5.6.3",
"webpack": "5.96.0",
"webpack-cli": "^5.1.4",
"yarpm": "^1.2.0"
},
"dependencies": {}
Expand Down
6 changes: 3 additions & 3 deletions src/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ AST.prototype.swapLocations = function (target, first, last, parser) {
if (this.withSource) {
target.loc.source = parser.lexer._input.substring(
target.loc.start.offset,
target.loc.end.offset
target.loc.end.offset,
);
}
}
Expand All @@ -208,7 +208,7 @@ AST.prototype.resolveLocations = function (target, first, last, parser) {
if (this.withSource) {
target.loc.source = parser.lexer._input.substring(
target.loc.start.offset,
target.loc.end.offset
target.loc.end.offset,
);
}
}
Expand Down Expand Up @@ -376,7 +376,7 @@ AST.prototype.prepare = function (kind, docs, parser) {
location = new Location(
src,
start,
new Position(parser.prev[0], parser.prev[1], parser.prev[2])
new Position(parser.prev[0], parser.prev[1], parser.prev[2]),
);
// last argument is always the location
args.push(location);
Expand Down
2 changes: 1 addition & 1 deletion src/ast/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ module.exports = Expr.extends(
Expr.apply(this, [KIND, docs, location]);
this.items = items;
this.shortForm = shortForm;
}
},
);
4 changes: 2 additions & 2 deletions src/ast/arrowfunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = Expression.extends(
nullable,
isStatic,
docs,
location
location,
) {
Expression.apply(this, [KIND, docs, location]);
this.arguments = args;
Expand All @@ -39,5 +39,5 @@ module.exports = Expression.extends(
this.type = type;
this.nullable = nullable;
this.isStatic = isStatic || false;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = Expression.extends(
this.left = left;
this.right = right;
this.operator = operator;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/assignref.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ module.exports = Expression.extends(
Expression.apply(this, [KIND, docs, location]);
this.left = left;
this.right = right;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Node.extends(
Node.apply(this, [KIND, docs, location]);
this.name = name;
this.args = args;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ module.exports = Operation.extends(
this.type = type;
this.left = left;
this.right = right;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ module.exports = Statement.extends(
function Block(kind, children, docs, location) {
Statement.apply(this, [kind || KIND, docs, location]);
this.children = children.filter(Boolean);
}
},
);
2 changes: 1 addition & 1 deletion src/ast/boolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ module.exports = Literal.extends(
KIND,
function Boolean(value, raw, docs, location) {
Literal.apply(this, [KIND, value, raw, docs, location]);
}
},
);
2 changes: 1 addition & 1 deletion src/ast/call.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Expression.extends(
Expression.apply(this, [KIND, docs, location]);
this.what = what;
this.arguments = args;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/case.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Statement.extends(
Statement.apply(this, [KIND, docs, location]);
this.test = test;
this.body = body;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = Operation.extends(
this.type = type;
this.raw = raw;
this.expr = expr;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/catch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ module.exports = Statement.extends(
this.body = body;
this.what = what;
this.variable = variable;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ module.exports = Declaration.extends(
this.body = body;
this.attrGroups = [];
this.parseFlags(flags);
}
},
);
4 changes: 2 additions & 2 deletions src/ast/classconstant.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ const ClassConstant = ConstantStatement.extends(
type,
attrGroups,
docs,
location
location,
) {
ConstantStatement.apply(this, [kind || KIND, constants, docs, location]);
this.parseFlags(flags);
this.nullable = nullable;
this.type = type;
this.attrGroups = attrGroups;
}
},
);

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ast/closure.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = Expression.extends(
nullable,
isStatic,
docs,
location
location,
) {
Expression.apply(this, [KIND, docs, location]);
this.uses = uses;
Expand All @@ -43,5 +43,5 @@ module.exports = Expression.extends(
this.isStatic = isStatic || false;
this.body = null;
this.attrGroups = [];
}
},
);
2 changes: 1 addition & 1 deletion src/ast/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ module.exports = Node.extends(
function Comment(kind, value, docs, location) {
Node.apply(this, [kind, docs, location]);
this.value = value;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/commentblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ module.exports = Comment.extends(
KIND,
function CommentBlock(value, docs, location) {
Comment.apply(this, [KIND, value, docs, location]);
}
},
);
2 changes: 1 addition & 1 deletion src/ast/commentline.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ module.exports = Comment.extends(
KIND,
function CommentLine(value, docs, location) {
Comment.apply(this, [KIND, value, docs, location]);
}
},
);
2 changes: 1 addition & 1 deletion src/ast/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Node.extends(
Node.apply(this, [KIND, docs, location]);
this.name = name;
this.value = value;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/constantstatement.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ module.exports = Statement.extends(
function ConstantStatement(kind, constants, docs, location) {
Statement.apply(this, [kind || KIND, docs, location]);
this.constants = constants;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/continue.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ module.exports = Statement.extends(
function Continue(level, docs, location) {
Statement.apply(this, [KIND, docs, location]);
this.level = level;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/declaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Declaration = Statement.extends(
function Declaration(kind, name, docs, location) {
Statement.apply(this, [kind || KIND, docs, location]);
this.name = name;
}
},
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ast/declare.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Declare = Block.extends(
Block.apply(this, [KIND, body, docs, location]);
this.directives = directives;
this.mode = mode;
}
},
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ast/declaredirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Node.extends(
Node.apply(this, [KIND, docs, location]);
this.key = key;
this.value = value;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/do.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Statement.extends(
Statement.apply(this, [KIND, docs, location]);
this.test = test;
this.body = body;
}
},
);
2 changes: 1 addition & 1 deletion src/ast/echo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = Statement.extends(
Statement.apply(this, [KIND, docs, location]);
this.shortForm = shortForm;
this.expressions = expressions;
}
},
);
Loading

0 comments on commit 7d8c5cc

Please sign in to comment.