Skip to content

Commit

Permalink
Upgrade toolchain (#1497)
Browse files Browse the repository at this point in the history
- Use tshy for builds
- Use vitest for tests
- Use tsx for scripts

BREAKING: The `lib` directory was renamed to `dist`, as that is what `tshy` asks for.
  • Loading branch information
fb55 authored Jun 26, 2024
1 parent b0759f7 commit 1da1f7a
Show file tree
Hide file tree
Showing 18 changed files with 3,231 additions and 6,488 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

52 changes: 36 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"extends": ["eslint:recommended", "plugin:n/recommended", "prettier"],
"extends": [
"eslint:recommended",
"prettier",
"plugin:n/recommended",
"plugin:unicorn/recommended"
],
"env": {
"node": true,
"es6": true
Expand All @@ -23,8 +28,14 @@
"curly": [2, "multi-line"],
"no-else-return": 2,

"n/no-missing-import": 0,
"n/no-unsupported-features/es-syntax": 0
"n/no-unpublished-import": 0,

"unicorn/no-null": 0,
"unicorn/prefer-code-point": 0,
"unicorn/prefer-string-slice": 0,
"unicorn/prefer-add-event-listener": 0,
"unicorn/prefer-at": 0,
"unicorn/prefer-string-replace-all": 0
},
"overrides": [
{
Expand All @@ -36,20 +47,15 @@
],
"parserOptions": {
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
"settings": {
"node": {
"tryExtensions": [".js", ".json", ".node", ".ts"]
}
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": [
2,
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/strict-boolean-expressions": 2,
"curly": [2, "multi-line"],

"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-use-before-define": [
2,
{ "functions": false }
Expand All @@ -65,7 +71,21 @@
"@typescript-eslint/prefer-includes": 2,
"@typescript-eslint/no-unnecessary-condition": 2,
"@typescript-eslint/switch-exhaustiveness-check": 2,
"@typescript-eslint/prefer-nullish-coalescing": 2
"@typescript-eslint/prefer-nullish-coalescing": 2,
"@typescript-eslint/consistent-type-imports": [
2,
{ "fixStyle": "inline-type-imports" }
],
"@typescript-eslint/consistent-type-exports": 2,

"n/no-missing-import": 0,
"n/no-unsupported-features/es-syntax": 0
}
},
{
"files": "*.spec.ts",
"rules": {
"n/no-unsupported-features/node-builtins": 0
}
}
]
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ jobs:
fail-fast: false
matrix:
node:
- 14
- 16
- 18
- 20
- 22
- lts/*

steps:
Expand All @@ -53,12 +54,12 @@ jobs:
- run: npm ci
- run: npm run build --if-present

- name: Run Jest
run: npm run test:jest
- name: Run tests
run: npm run test:vi
if: matrix.node != env.NODE_COV

- name: Run Jest with coverage
run: npm run test:jest -- --coverage
- name: Run tests with coverage
run: npm run test:vi -- --coverage
if: matrix.node == env.NODE_COV

- name: Run Coveralls
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
coverage/
lib/
dist/
.tshy/
docs/
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
node_modules/
coverage/
lib/
maps/
Loading

0 comments on commit 1da1f7a

Please sign in to comment.