Skip to content

Commit

Permalink
Upgrade setup and use Node 20 (#3)
Browse files Browse the repository at this point in the history
* Update eslint and mocha setup

* Update workflow

* Fix and supress eslint errors
  • Loading branch information
borisskert committed Jul 6, 2024
1 parent 459a69d commit 8ce67b1
Show file tree
Hide file tree
Showing 17 changed files with 2,218 additions and 3,894 deletions.
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'

- run: npm ci
- run: npm run lint
Expand Down
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extension": ["ts"],
"spec": "test/**/*.spec.ts",
"require": "ts-node/register"
}
52 changes: 52 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import love from 'eslint-config-love'
import tseslint from 'typescript-eslint'

export default [
love,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
plugins: {
tseslint: tseslint
},
rules: {
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
}],
"@typescript-eslint/unbound-method": ['error', {
ignoreStatic: true,
}],
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
}
}
},
{
ignores: ['dist/**/*.*', '**/*.js', '**/*.mjs']
},
{
files: ['src/**/*.ts'],
languageOptions: {
parserOptions: {
project: ['tsconfig.json']
}
}
},
{
files: ['test/**/*.ts'],
languageOptions: {
parserOptions: {
project: ['tsconfig.test.json']
}
},
rules: {
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
}],
}
}
]
Loading

0 comments on commit 8ce67b1

Please sign in to comment.