Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use strict config set from ts-eslint #14546

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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