Skip to content

Commit

Permalink
feat: updating library to node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
Farenheith committed Sep 17, 2024
1 parent 627ae68 commit f36bdf7
Show file tree
Hide file tree
Showing 82 changed files with 13,381 additions and 5,175 deletions.
129 changes: 126 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,129 @@
module.exports = {
extends: require.resolve('@codibre/confs/.eslintrc.js'),
env: {
browser: true,
es6: true,
node: true,
},
overrides: [{
files: ['test/*.ts', 'test/**/*.ts'],
rules: {
'no-magic-numbers': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
}, ],
ignorePatterns: ['dist/**', 'build/**', 'bin/**', 'templates/**', '*.py', ".eslintrc.js", "babel.config.js", "jest.config.js"],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['tsconfig.json'],
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'unused-imports'],
rules: {
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/no-explicit-any': 'off',
}
}
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
'@typescript-eslint/semi': ['error', 'always'],
camelcase: 'error',
'comma-dangle': ['error', 'always-multiline'],
complexity: [
'off',
{
max: 11,
},
],
curly: ['error', 'multi-line'],
'default-case': 'error',
'eol-last': 'error',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-blacklist': 'error',
'id-match': 'error',
'linebreak-style': ['error', 'unix'],
'max-classes-per-file': ['off', 1],
'max-lines': ['off', 300],
'new-parens': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-fallthrough': 'error',
'no-invalid-regexp': 'error',
'no-invalid-this': 'off',
'no-magic-numbers': [
'error',
{
ignore: [0, 1, -1],
},
],
'no-multiple-empty-lines': [
'error',
{
max: 2,
},
],
'no-new-wrappers': 'error',
'no-redeclare': 'off',
"@typescript-eslint/no-redeclare": ["error"],
'no-regex-spaces': 'error',
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'error',
'no-unsafe-finally': 'error',
'no-unused-labels': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports-ts': 'error',
'unused-imports/no-unused-vars-ts': [
'error',
{ 'vars': 'all', 'varsIgnorePattern': '^_', 'args': 'after-used', 'argsIgnorePattern': '^_' }
],
'prefer-const': [
'error',
{
destructuring: 'any',
},
],
'quote-props': ['error', 'as-needed'],
radix: 'error',
'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
'use-isnan': 'error',
},
};
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: "10.x"
node-version: "22.x"
- run: printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
- run: npm ci
- run: npm run build --if-present
Expand Down
4 changes: 0 additions & 4 deletions .mocharc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
22
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
26 changes: 26 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"testRegex": ".spec.ts$",
transform: {
"^.+.tsx?$": ["ts-jest",{}],
},
preset: 'ts-jest',
"coverageDirectory": "./coverage",
"collectCoverageFrom": [
"./src/**/*.ts"
],
"testEnvironment": "node",
"setupFilesAfterEnv": [
"jest-extended/all",
"./test/jest-setup.ts"
],
"moduleNameMapper": {
"^src/(.*)": "<rootDir>/src/$1",
"^test/(.*)": "<rootDir>/test/$1"
}
}
Loading

0 comments on commit f36bdf7

Please sign in to comment.