Package versions:
eslint@7.32.0
prettier@2.4.1
eslint-plugin-prettier@4.0.0
I've got the following eslintrc, which is just the stock config from NestJS:
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 is the prettier config:
{
"singleQuote": true,
"trailingComma": "all"
}
And this is the tsconfig:
{
"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, I have a class like this:
@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);
}
}
This code runs fine, but when I try to lint, I get the following error:
/app/src/auth/strategy/firebase.strategy.ts
22:12 error Parsing error: Unexpected token prettier/prettier
Is there a way to fix this? I'd prefer not to have implicit overrides.