Skip to main content
interlace
Plugin: import-nextRules

no-unresolved

Ensures imports point to resolvable modules

💼 This rule is enabled in the following configs: recommended, typescript. 💡 This rule is manually fixable by editor suggestions.

Rule Details

This rule aims to prevent issues related to unresolved.

Options

[
  {
    "type": "object",
    "properties": {
      "extensions": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "File extensions to consider when resolving imports."
      },
      "ignore": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Modules/patterns to ignore during resolution."
      },
      "allowUnresolved": {
        "type": "boolean",
        "default": false,
        "description": "Allow unresolved imports in certain contexts."
      }
    },
    "additionalProperties": false
  }
]

Implementation

OWASP Foundation

  • Category: A03:2021 - Injection

Use this rule

npm install -D oxlint-plugin-import-next
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-import-next"],  "rules": {    "import-next/no-unresolved": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-import-next'],    rules: {      'import-next/no-unresolved': 'error',    },  },});

oxlint-plugin-import-next re-exports eslint-plugin-import-next/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.

Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.