@litsx/eslint-plugin
v0.3.0
Published
Official ESLint processor support for LitSX-authored syntax
Readme
@litsx/eslint-plugin
Official ESLint support for LitSX-authored syntax.
This package is processor-first:
- LitSX-authored source is virtualized before ESLint parses it
- ESLint findings are remapped back to original authored positions
- LitSX-specific semantic rules run with normal ESLint
ruleIds
It does not ship a dedicated LitSX parser.
Installation
npm install -D eslint @litsx/eslint-pluginFlat Config
import litsx from "@litsx/eslint-plugin";
export default [
litsx.configs["recommended-flat"],
];Other shipped flat presets:
litsx.configs["recommended-lint-flat"]litsx.configs["recommended-react-migration-flat"]litsx.configs["strict-flat"]
Classic Config
{
"extends": ["plugin:@litsx/recommended"]
}Other shipped classic presets:
plugin:@litsx/recommended-lintplugin:@litsx/recommended-react-migrationplugin:@litsx/strict
recommended is the editor-friendly baseline:
- LitSX source is processed correctly
- it avoids duplicating inline feedback that
@litsx/typescript-pluginalready shows in editors - it disables the processor's baseline authored diagnostics too
Use recommended-lint when you want ESLint itself to enforce the LitSX semantic rules in CI or editor linting.
Included Rules
Shipped in recommended-lint:
@litsx/no-native-classname@litsx/no-invalid-binding-value@litsx/no-unknown-binding@litsx/static-hoists-top-level@litsx/no-duplicate-static-hoist@litsx/no-react-memo@litsx/no-react-compat-surface@litsx/prefer-destructured-props@litsx/no-opaque-prop-metadata-inference@litsx/require-top-level-hoists-first@litsx/no-unknown-static-hoist
Autofix
The plugin only autofixes safe, unambiguous cases.
Today that means:
className->classon native LitSX intrinsic elements
Notes
- The plugin is designed to work with LitSX-authored forms such as
@click,.value,?disabled, andstatic styles = .... - Processor mode means lint messages are reported on the original source even though ESLint parses a virtualized version internally.
- Prettier support is still a separate gap; this package only covers linting.
