mirror of
https://github.com/theoludwig/eslint-config-conventions.git
synced 2025-10-21 07:35:11 +02:00
feat: add @typescript-eslint/no-require-imports
Not considered breaking, as `@typescript-eslint/no-var-requires` is already there.
You should already not use, `require` in your codebase.
It was a mistake to not include this rule.
However, the newly added rule, will now report an error for the following example code:
```tsx
const [loaded, error] = useFonts({
CustomFont: require("../assets/fonts/CustomFont.ttf")
})
```
Must read: "Every change breaks someones workflow", https://xkcd.com/1172/
This commit is contained in:
@@ -321,6 +321,7 @@
|
||||
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||
"@typescript-eslint/no-var-requires": "error",
|
||||
"@typescript-eslint/no-require-imports": "error",
|
||||
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
||||
"@typescript-eslint/no-array-delete": "error",
|
||||
"@typescript-eslint/prefer-as-const": "error",
|
||||
|
||||
Reference in New Issue
Block a user