Skip to content

Commit

Permalink
remove array-type eslint rule (#1028)
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Bailey <[email protected]>
  • Loading branch information
iisaduan and jakebailey authored Oct 14, 2024
1 parent af4e157 commit 9f35009
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-students-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@definitelytyped/eslint-plugin": patch
---

Remove array-type from config
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/configs/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ export const all: Linter.BaseConfig = {
"@typescript-eslint/triple-slash-reference": ["error", { types: "prefer-import", path: "always" }],
"@typescript-eslint/no-empty-interface": "error",
"no-duplicate-imports": "error",
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
types/expect/index.d.ts
7:12 error Array type using 'readonly T[]' is forbidden for non-simple types. Use 'ReadonlyArray<T>' instead @typescript-eslint/array-type

✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
No errors

==== types/expect/index.d.ts ====

Expand All @@ -13,7 +9,5 @@ types/expect/index.d.ts
export function complicatedUnion<T extends string | number>(x: T, y: T): {
prop1: "a" | "b" | "c";
prop2: readonly (string | number)[];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! @typescript-eslint/array-type: Array type using 'readonly T[]' is forbidden for non-simple types. Use 'ReadonlyArray<T>' instead.
prop3: ReadonlyArray<string | number>;
};
6 changes: 0 additions & 6 deletions packages/eslint-plugin/test/__snapshots__/plugin.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ exports[`plugin should have the expected exports 1`] = `
"@definitelytyped/redundant-undefined": "error",
"@definitelytyped/strict-export-declare-modifiers": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple",
},
],
"@typescript-eslint/ban-ts-comment": [
"error",
{
Expand Down

0 comments on commit 9f35009

Please sign in to comment.