ESLint plugin providing comprehensive linting rules specifically designed for the Qwik framework with performance-focused development patterns
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Core plugin exports and configuration management for ESLint Plugin Qwik.
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;
}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 issuesconfigs.strict: Stricter rule levels with most rules as errorsModern 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"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';
};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 pathExample Configuration:
// Flat config
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
}
// Legacy config
{
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
}// 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[]];
}