Added linting so everything gets absolutly imported
This commit is contained in:
parent
6113478acd
commit
c83319c300
@ -5,7 +5,7 @@ module.exports = {
|
||||
tsconfigRootDir: __dirname,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
plugins: ['@typescript-eslint/eslint-plugin', 'no-relative-import-paths'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:prettier/recommended',
|
||||
@ -21,5 +21,9 @@ module.exports = {
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'no-relative-import-paths/no-relative-import-paths': [
|
||||
'error',
|
||||
{ 'allowSameFolder': true, 'rootDir': 'src' }
|
||||
]
|
||||
},
|
||||
};
|
||||
|
@ -81,6 +81,7 @@
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-no-relative-import-paths": "^1.4.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^28.1.3",
|
||||
"prettier": "^2.7.1",
|
||||
|
@ -12,11 +12,11 @@ import {
|
||||
UseGuards,
|
||||
ValidationPipe
|
||||
} from '@nestjs/common';
|
||||
import { AuthService } from '../services/auth';
|
||||
import { AuthService } from 'services/auth';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Public } from '../authguards';
|
||||
import { Public } from 'authguards';
|
||||
import { Requests, Responses } from 'dto';
|
||||
import { tfaTypes } from '../entities';
|
||||
import { tfaTypes } from 'entities';
|
||||
import { toDataURL } from 'qrcode';
|
||||
import * as base32 from 'thirty-two';
|
||||
|
||||
|
@ -10,9 +10,9 @@ import {
|
||||
ValidationPipe
|
||||
} from '@nestjs/common';
|
||||
import { Responses, Requests, validateAsyncInline } from 'dto';
|
||||
import FileSystemService from '../services/filesystem';
|
||||
import { UserRole } from '../entities';
|
||||
import { Role } from '../authguards';
|
||||
import FileSystemService from 'services/filesystem';
|
||||
import { UserRole } from 'entities';
|
||||
import { Role } from 'authguards';
|
||||
|
||||
@Controller('api/fs')
|
||||
export default class FileSystemController {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Controller, Get, Post, Request } from '@nestjs/common';
|
||||
import { AuthService } from '../services/auth';
|
||||
import { AuthService } from 'services/auth';
|
||||
import { Responses } from 'dto';
|
||||
|
||||
@Controller('api/user')
|
||||
|
@ -1,14 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { INode, JWTToken, User } from '../entities';
|
||||
import {
|
||||
AuthService,
|
||||
AuthLocalService,
|
||||
AuthJwtService
|
||||
} from '../services/auth';
|
||||
import FileSystemService from '../services/filesystem';
|
||||
import AuthController from '../controller/auth';
|
||||
import UserController from '../controller/user';
|
||||
import { INode, JWTToken, User } from 'entities';
|
||||
import { AuthService, AuthLocalService, AuthJwtService } from 'services/auth';
|
||||
import FileSystemService from 'services/filesystem';
|
||||
import AuthController from 'controller/auth';
|
||||
import UserController from 'controller/user';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([User, INode, JWTToken])],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { INode } from '../entities';
|
||||
import FileSystemService from '../services/filesystem';
|
||||
import FileSystemController from '../controller/filesystem';
|
||||
import { INode } from 'entities';
|
||||
import FileSystemService from 'services/filesystem';
|
||||
import FileSystemController from 'controller/filesystem';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([INode])],
|
||||
|
@ -4,10 +4,10 @@ import {
|
||||
UnauthorizedException
|
||||
} from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { JWTToken, User, UserRole } from '../../entities';
|
||||
import { JWTToken, User, UserRole } from 'entities';
|
||||
import { LessThanOrEqual, Repository } from 'typeorm';
|
||||
import * as argon2 from 'argon2';
|
||||
import FileSystemService from '../filesystem';
|
||||
import FileSystemService from 'services/filesystem';
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
|
||||
export const jwtSecret = 'CUM';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { User, UserRole } from '../../entities';
|
||||
import { User, UserRole } from 'entities';
|
||||
import { FastifyRequest } from 'fastify';
|
||||
import axios from 'axios';
|
||||
import * as argon2 from 'argon2';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { tfaTypes, User } from '../../entities';
|
||||
import { tfaTypes, User } from 'entities';
|
||||
import { BadRequestException } from '@nestjs/common';
|
||||
import BaseAuthService from './base';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
UnauthorizedException
|
||||
} from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { INode, User } from '../entities';
|
||||
import { INode, User } from 'entities';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Multipart } from '@fastify/multipart';
|
||||
import { pipeline } from 'stream/promises';
|
||||
|
@ -9,7 +9,7 @@
|
||||
"target": "es2017",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./",
|
||||
"baseUrl": "./src",
|
||||
"incremental": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
|
@ -2465,6 +2465,11 @@ eslint-config-prettier@^8.5.0:
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
|
||||
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
|
||||
|
||||
eslint-plugin-no-relative-import-paths@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.4.0.tgz#59489ebc19688d1398bfe53d3ad320b3ed42ca17"
|
||||
integrity sha512-J/ok26KqJM+20VsxNEcHc9kyW0dcFHBlihOO5FFv/GQqwcW+G1UngbHLpnPAdOQ1dJg5Ljk/40csqfZ3mnneUw==
|
||||
|
||||
eslint-plugin-prettier@^4.2.1:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
|
||||
|
Loading…
Reference in New Issue
Block a user