Bug: [array-type] the config simple-array
should be disallowed by the schema
#6852
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
good first issue
Good for newcomers
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.0.2&sourceType=module&code=MYewdgzgLgBAhgLhgCmgJwJZgOYwD4xgCuAtgEYCmaAlANoC6MAvDAwNwBQoksZSx5Kg2at6nbtBjAkAQTRo4ATwA86LLgIDKaAHwj2XcJIAms+UuVaqeluyA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AQ2mncNqNPRgA2pERcA9tEgAaTJAAmiAGbsE+QZGSUAtsSS1O3QpAC+AXXBgTIE0A
Repro Code
ESLint Config
tsconfig
No response
Expected Result
The constants a and d should fail the 'array-simple' rule and thus cause the following errors:
a:
Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>'
d:
Array type using 'Array<number>' is forbidden for simple types. Use 'number[]' instead.
Actual Result
All four constants fail the rule and cause errors. This means for example that neither
number[]
norArray<number>
is allowed, making it impossible to annotate array types without causing eslint error, if the "array-type" rule is configured with "simple-array".Additional Info
No response
The text was updated successfully, but these errors were encountered: