CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-eslint-plugin-import-x

ESLint plugin providing comprehensive linting rules for ES2015+ import/export syntax with static analysis and module system enforcement.

80

0.96x
Overview
Eval results
Files

task.mdevals/scenario-3/

Import/Export Correctness Linting

Build a linting setup that enforces ES module import/export correctness for a small JavaScript codebase.

Capabilities

Valid modules pass

  • src/valid/math.js exports named helpers (for example add and multiply) with no default export, and src/valid/index.js imports those names without errors. @test

Named vs default validation

  • Linting src/invalid/bad-named.js fails because it requests a named import (e.g., total) that src/valid/math.js does not export.
  • Linting src/invalid/bad-default.js fails because it default-imports src/valid/math.js, which should be treated as a named-exports-only module. @test

Path and self-guardrails

  • Linting src/invalid/missing-path.js fails because the referenced module path cannot be resolved using the configured extensions.
  • Linting src/invalid/self-cycle.js fails because the module directly imports itself (including via a relative alias). @test

Implementation

  • Provide an ESLint configuration that enables import/export validation for src/**/*.js files and enforces the behaviors above.
  • Include runnable lint commands that target the sample files in src/valid and src/invalid.

@generates

API

export default [
  // Flat config entries enabling import/export validation for src/**/*.js
];

Dependencies { .dependencies }

eslint-plugin-import-x { .dependency }

Lints ES module import/export correctness.

Install with Tessl CLI

npx tessl i tessl/npm-eslint-plugin-import-x

tile.json