Skip to content

posva/oxlint-plugin-posva

oxlint-plugin-posva

npm version ci

Personal oxlint rules plugin.

Installation

pnpm add -D oxlint-plugin-posva

Configuration

In .oxlintrc.json:

{
  "$schema": "./node_modules/oxlint-plugin-posva/schema.json",
  "jsPlugins": ["oxlint-plugin-posva"],
  "rules": {
    "posva/vitest-prefer-to-have-been-called-times": "error",
  },
}

Editor Autocompletion

The $schema above extends the base oxlint schema with typed entries for this plugin's rules, giving you autocompletion for rule names and their options.

If you use multiple JS plugins that each ship their own schema, you can create a local schema that merges them all with allOf:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "allOf": [
    { "$ref": "./node_modules/oxlint-plugin-posva/schema.json" },
    { "$ref": "./node_modules/oxlint-plugin-other/schema.json" }
  ]
}

Save it as e.g. oxlintrc-schema.json and reference it in your config:

{
  "$schema": "./oxlintrc-schema.json",
}

Rules

style

Rule Description Fixable
style-prefer-inline-variable Flag variables read only once, suggest inlining. Option ignoreMultipleWords (default: true) Yes

vitest

Rule Description Fixable
vitest-prefer-to-have-been-called-times Enforce toHaveBeenCalledTimes(N) over toHaveBeenCalledOnce() or not.toHaveBeenCalled() Yes

License

MIT

About

Personal linting rules for oxlint

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from posva/template-lib-ts