Software Versions:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a0f190603041e2a5d445958445a">[email protected]</a>
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70000215040419150230425e445e41">[email protected]</a>
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8de8fee1e4e3f9a0fde1f8eae4e3a0fdffe8f9f9e4e8ffcdb9a3bda3bd">[email protected]</a>
The following configuration is for eslintrc, taken from NestJS stock config:
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'filenames'
],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'filenames/match-regex': [2, "^[0-9a-z-.]+$", true]
},
};
This configures Prettier:
{
"singleQuote": true,
"trailingComma": "all"
}
And here is the tsconfig configuration:
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"esModuleInterop": true,
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": ".",
"rootDir": ".",
"incremental": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strictNullChecks": true,
"noImplicitAny": true,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitOverride": true
}
}
In my code implementation, I have a class defined like so:
@Injectable()
export class FirebaseStrategy extends PassportStrategy(
FirebaseAuthStrategy,
'firebase',
) {
constructor(private usersService: UsersService) {
super({ extractor: ExtractJwt.fromAuthHeaderAsBearerToken() });
}
override async validate(payload: FirebaseUser): Promise<User | undefined> {
return this.usersService.findByFirebaseUid(payload.uid);
}
}
The code runs without issues but I encounter an error when linting:
/app/src/auth/strategy/firebase.strategy.ts
22:12 error Parsing error: Unexpected token prettier/prettier
Is there a solution to resolve this issue? Ideally, I would prefer avoiding implicit overrides.