Registry / devops / opencode-eslint-formatter

opencode-eslint-formatter

JSON →
library0.1.0jsnpmunverified

OpenCode plugin (v0.1.0) that automatically configures ESLint as formatter and LSP when an ESLint config is detected in the project. It detects a wide range of ESLint config files, disables Prettier to avoid conflicts, and sets up ESLint as the formatter (with --fix) and the vscode-eslint-language-server for LSP. Differentiators: zero-config setup, seamless integration with OpenCode. Release cadence: initial release.

npm install opencode-eslint-formatter
INSTALL
IMPORT
SIG · OPENCODE-ESLINT-FO
O
opencode-eslint-formatter
devopsjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createEslintFormatterPlugin
import { createEslintFormatterPlugin } from 'opencode-eslint-formatter'
import createEslintFormatterPlugin from 'opencode-eslint-formatter'
Named export only; default import is not available.
EslintFormatterPluginOptions
import type { EslintFormatterPluginOptions } from 'opencode-eslint-formatter'
TypeScript users should import the type for options.
ESLintFormatterPlugin
import type { ESLintFormatterPlugin } from 'opencode-eslint-formatter'
Type of the returned plugin, useful for typing.

Creates an ESLint formatter plugin for OpenCode. The plugin auto-detects ESLint config files and adjusts formatter and LSP settings.

import { createEslintFormatterPlugin } from 'opencode-eslint-formatter'; export const EslintFormatter = createEslintFormatterPlugin(); export const EslintFormatterWithOptions = createEslintFormatterPlugin({ enable: true });
Debug
Known issues
gotchaRequires yarn and eslint installed in the project; the plugin uses yarn to run eslint --fix. Using different package manager may fail.
fix
Ensure yarn is available or modify the command in the plugin options (currently not exposed). Consider installing eslint and yarn locally.
affects: >=0.1.0
gotchaPlugin disables Prettier formatter when ESLint config detected; if you want both, manual configuration is needed.
fix
After plugin runs, manually re-enable Prettier in OpenCode config if needed.
affects: >=0.1.0
gotchaRequires vscode-eslint-language-server to be installed globally or in the project for LSP support; not automatically installed.
fix
Install the language server: npm install -g vscode-eslint-language-server or add as dev dependency.
affects: >=0.1.0
gotchaPlugin is designed for OpenCode; may not work with other editors or IDEs without OpenCode.
fix
Use only within OpenCode environment.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'vscode-eslint-language-server'
The LSP server is not installed.
fix
Run: npm install -g vscode-eslint-language-server or add it to your project's devDependencies.
Formatter command failed: yarn eslint --fix
yarn or eslint not available in the project.
fix
Install eslint as a dev dependency and ensure yarn is used (or switch to npm by modifying the command manually).
TypeError: createEslintFormatterPlugin is not a function
Improper import: default import used instead of named import.
fix
Use import { createEslintFormatterPlugin } from 'opencode-eslint-formatter'.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
typescriptoptionalpeer dependency for TypeScript support
Agent activity
6 hits · last 30 days
node
6
Resources
opencode-eslint-formatter — npm install opencode-eslint-formatter · libregistry