Skip to content

Commit

Permalink
chore: use strict config set from ts-eslint (#14546)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 19, 2023
1 parent 1a96a5c commit bd2305b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ module.exports = {
},
overrides: [
{
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
extends: ['plugin:@typescript-eslint/strict', 'plugin:import/typescript'],
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint/eslint-plugin', 'local'],
rules: {
Expand All @@ -60,9 +57,11 @@ module.exports = {
'consistent-return': 'off',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
// TODO: enable at some point
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',

// TODO: part of "stylistic" rules, remove explicit activation when that lands
'@typescript-eslint/no-empty-function': 'error',
Expand Down Expand Up @@ -350,6 +349,8 @@ module.exports = {
files: ['**/__typetests__/**'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
},
},
{
Expand Down Expand Up @@ -377,6 +378,7 @@ module.exports = {
'**/__typetests__/**',
],
rules: {
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
'no-console': 'off',
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ export class ModuleMocker {
};
}

/* eslint-disable @typescript-eslint/unified-signatures */
private _makeComponent<T extends Record<string, any>>(
metadata: MockMetadata<T, 'object'>,
restore?: () => void,
Expand All @@ -625,6 +626,7 @@ export class ModuleMocker {
metadata: MockMetadata<T, 'function'>,
restore?: () => void,
): Mock<T>;
/* eslint-enable @typescript-eslint/unified-signatures */
private _makeComponent<T extends UnknownFunction>(
metadata: MockMetadata<T>,
restore?: () => void,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-test-sequencer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type ShardPositionOptions = ShardOptions & {
export default class TestSequencer {
private readonly _cache = new Map<TestContext, Cache>();

// eslint-disable-next-line @typescript-eslint/no-empty-function
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-useless-constructor
constructor(_options: TestSequencerOptions) {}

_getCachePath(testContext: TestContext): string {
Expand Down

0 comments on commit bd2305b

Please sign in to comment.