Skip to content

Commit

Permalink
chore: updating dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Farenheith committed Oct 1, 2024
1 parent 4ddfe5f commit a151984
Show file tree
Hide file tree
Showing 14 changed files with 10,578 additions and 21,916 deletions.
129 changes: 0 additions & 129 deletions .eslintrc.js

This file was deleted.

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@v4
with:
node-version: "16.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
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
4 changes: 0 additions & 4 deletions .huskyrc

This file was deleted.

4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.ts": "npm run lint:fix",
"*.js": "npm run lint:fix"
}
210 changes: 210 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import stylistic from '@stylistic/eslint-plugin';
import unusedImports from 'eslint-plugin-unused-imports';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';

const MAX_LINES = 300;

export default [
{
ignores: [
'dist/**/*',
'build/**/*',
'bin/**/*',
'templates/**/*',
'**/*.py',
'**/.eslintrc.js',
'coverage/**',
],
},
{
plugins: {
'@stylistic': stylistic,
'@typescript-eslint': typescriptEslint,
'unused-imports': unusedImports,
},

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

parser: tsParser,
ecmaVersion: 5,
sourceType: 'module',

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

rules: {
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},

singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],

'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-use-before-define': 'error',

'@stylistic/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],

'@stylistic/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', MAX_LINES],
'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': 'off',

'@typescript-eslint/no-magic-numbers': [
'error',
{
ignore: [0, 1, -1],
ignoreEnums: true,
},
],

'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': 'off',
'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': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-return': 'error',

'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'never',
},
],

'unused-imports/no-unused-vars': [
'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',
},
},
{
files: ['test/**/*.ts', 'test/**/*.js'],

rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
},
},
{
files: ['test/**/*.ts'],

rules: {
'no-magic-numbers': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
},
},
];
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',
},
};
5 changes: 5 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"entryFile": "index"
}
Loading

0 comments on commit a151984

Please sign in to comment.