CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-eslint-plugin-qwik

ESLint plugin providing comprehensive linting rules specifically designed for the Qwik framework with performance-focused development patterns

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

configuration.mddocs/

Plugin Configuration

Core plugin exports and configuration management for ESLint Plugin Qwik.

Capabilities

Rules Export

Collection of all 11 ESLint rules provided by the plugin.

/**
 * Object containing all ESLint rules provided by the plugin
 */
export const rules: Rules;

interface Rules {
  'valid-lexical-scope': Rule;
  'use-method-usage': Rule;
  'no-react-props': Rule;
  'loader-location': Rule;
  'prefer-classlist': Rule;
  'jsx-no-script-url': Rule;
  'jsx-key': Rule;
  'unused-server': Rule;
  'jsx-img': Rule;
  'jsx-a': Rule;
  'no-use-visible-task': Rule;
}

Legacy Configuration

Pre-configured rulesets for legacy ESLint configurations (< v9).

/**
 * Legacy ESLint configurations with pre-defined rule severity levels
 */
export const configs: Record<string, TSESLint.ClassicConfig.Config>;

interface Config extends TSESLint.ClassicConfig.Config {
  plugins: ['qwik'];
  rules: {
    'qwik/valid-lexical-scope': 'error' | 'warn';
    'qwik/use-method-usage': 'error' | 'warn';
    'qwik/no-react-props': 'error' | 'warn';
    'qwik/loader-location': 'error' | 'warn';
    'qwik/prefer-classlist': 'error' | 'warn';
    'qwik/jsx-no-script-url': 'error' | 'warn';
    'qwik/jsx-key': 'error' | 'warn';
    'qwik/unused-server': 'error' | 'warn';
    'qwik/jsx-img': 'error' | 'warn';
    'qwik/jsx-a': 'error' | 'warn';
    'qwik/no-use-visible-task': 'error' | 'warn';
  };
}

Available Configurations:

  • configs.recommended: Balanced rule levels with errors for critical issues
  • configs.strict: Stricter rule levels with most rules as errors

Flat Config Plugin (ESLint 9+)

Modern ESLint flat configuration plugin object with metadata and configurations.

/**
 * ESLint 9+ flat config plugin object with configurations and metadata
 */
export const qwikEslint9Plugin: {
  configs: {
    readonly recommended: TSESLint.FlatConfig.ConfigArray;
    readonly strict: TSESLint.FlatConfig.ConfigArray;
  };
  meta: {
    name: string;
    version: string;
  };
  rules: Rules;
};

type ConfigArray = Array<{
  plugins: {
    qwik: typeof qwikEslint9Plugin;
  };
  rules: TSESLint.FlatConfig.Rules;
}>;

Usage Examples:

// Using recommended configuration
import { qwikEslint9Plugin } from 'eslint-plugin-qwik';

export default [
  qwikEslint9Plugin.configs.recommended,
  // Additional configuration...
];

// Using strict configuration
export default [
  qwikEslint9Plugin.configs.strict,
  // Additional configuration...
];

// Accessing metadata
console.log(qwikEslint9Plugin.meta.name); // "eslint-plugin-qwik"
console.log(qwikEslint9Plugin.meta.version); // "1.16.0"

Rule Severity Levels

Pre-defined rule severity configurations for different use cases.

// Recommended rule levels (balanced approach)
const recommendedRulesLevels: TSESLint.FlatConfig.Rules = {
  'qwik/valid-lexical-scope': 'error';
  'qwik/use-method-usage': 'error';
  'qwik/no-react-props': 'error';
  'qwik/loader-location': 'warn';
  'qwik/prefer-classlist': 'warn';
  'qwik/jsx-no-script-url': 'warn';
  'qwik/jsx-key': 'warn';
  'qwik/unused-server': 'error';
  'qwik/jsx-img': 'warn';
  'qwik/jsx-a': 'warn';
  'qwik/no-use-visible-task': 'warn';
};

// Strict rule levels (maximum enforcement)
const strictRulesLevels: TSESLint.FlatConfig.Rules = {
  'qwik/valid-lexical-scope': 'error';
  'qwik/use-method-usage': 'error';
  'qwik/no-react-props': 'error';
  'qwik/loader-location': 'error';
  'qwik/prefer-classlist': 'error';
  'qwik/jsx-no-script-url': 'error';
  'qwik/jsx-key': 'error';
  'qwik/unused-server': 'error';
  'qwik/jsx-img': 'error';
  'qwik/jsx-a': 'error';
  'qwik/no-use-visible-task': 'warn';
};

Integration Requirements

TypeScript Configuration

The plugin requires TypeScript parser options for type-aware linting capabilities.

Required Parser Options:

  • projectService: true (ESLint 9+) or project: ['./tsconfig.json'] (legacy)
  • tsconfigRootDir: Project root directory path

Example Configuration:

// Flat config
{
  languageOptions: {
    parserOptions: {
      projectService: true,
      tsconfigRootDir: import.meta.dirname,
    },
  },
}

// Legacy config
{
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
  },
}

Types

// Core ESLint types from @typescript-eslint/utils
type Rule = TSESLint.RuleModule<any, any>;
type Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;

// Configuration interfaces
interface TSESLint.ClassicConfig.Config {
  plugins?: string[];
  rules?: TSESLint.FlatConfig.Rules;
  extends?: string[];
}

interface TSESLint.FlatConfig.ConfigArray extends Array<TSESLint.FlatConfig.Config> {}

interface TSESLint.FlatConfig.Rules {
  [ruleName: string]: 'error' | 'warn' | 'off' | ['error' | 'warn' | 'off', ...any[]];
}

docs

configuration.md

core-rules.md

index.md

jsx-rules.md

quality-rules.md

tile.json