Skip to content
LogoLogo

Rules

Oxcruise has 17 built-in rules. Each rule is in one category. A category switches all its rules on or off together. See Rules and categories.

RuleCategoryDefault
circular-dependenciescorrectnesserror
cross-package-relative-dependenciescorrectnesserror
dependencies-on-testscorrectnesserror
deprecated-dependenciessuspiciouswarn
dev-dependencies-in-productioncorrectnesserror
duplicate-packagessuspiciouswarn
folder-structurenurseryoff
layersrestrictionoff
optional-dependenciesrestrictionoff
orphan-modulessuspiciouswarn
peer-dependenciesrestrictionoff
undeclared-packagescorrectnesserror
unresolved-dependenciescorrectnesserror
unused-exportsnurseryoff
unused-modulesnurseryoff
unused-packagesnurseryoff
visibilityrestrictionoff

Correctness

Default level: error.

Suspicious

Default level: warn.

  • deprecated-dependencies: Reports imports of deprecated Node.js built-in modules and deprecated npm packages.
  • duplicate-packages: Reports a package that more than one package.json section declares, for example both dependencies and devDependencies.
  • orphan-modules: Reports modules that no other module imports and that import no module.

Restriction

Default level: off.

  • layers: Enforces a layered architecture: a layer can import only the layers that allow lists for it.
  • optional-dependencies: Reports use of optional dependencies.
  • peer-dependencies: Reports use of peer dependencies.
  • visibility: Restricts what a folder shows to the code outside it.

Nursery

Default level: off.

  • folder-structure: Checks the shape of the file tree: the files that a folder must have, the names that it can have, and the case of its names.
  • unused-exports: Reports exports that no other module imports.
  • unused-modules: Reports source modules that no path from an entry point reaches.
  • unused-packages: Reports a package that a package.json declares and that none of its modules imports.

Conventions

A convention tells the unused-* rules what a tool loads by itself. A convention is active in a package.json that declares one of its packages. When a convention lists no packages, it is always active.

  • The entry points are globs relative to that package.json. They are files that the tool loads.
  • The unused-packages rule counts the packages of a convention as used.
  • Use the conventions option of the rules to switch conventions off or to select some of them.
ConventionActive when it declaresEntry pointsPackages used
vitestvitest**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}
**/__tests__/**
vitest.config.*
vitest.workspace.*
vitest.setup.*
@vitest/*
jsdom
happy-dom
jestjest**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}
**/__tests__/**
**/__mocks__/**
jest.config.*
jest.setup.*
@jest/*
@types/jest
babel-jest
ts-jest
jest-*
mochamochatest/**
tests/**
**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}
@types/mocha
avaavatest/**
tests/**
**/*.test.{js,jsx,ts,tsx,mjs,cjs,mts,cts}
ava.config.*
@ava/*
node-test–**/*.test.{js,jsx,ts,tsx,mjs,cjs,mts,cts}–
playwright@playwright/test
playwright
playwright.config.*
e2e/**
tests/**
**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}
@playwright/*
cypresscypresscypress.config.*
cypress/**
@cypress/*
storybookstorybook
@storybook/react
@storybook/vue3
@storybook/svelte
@storybook/angular
@storybook/nextjs
@storybook/react-vite
@storybook/web-components
@storybook/html
**/*.stories.{js,jsx,ts,tsx,mjs,cjs,mts,cts,svelte,vue}
**/*.mdx
.storybook/**
@storybook/*
storybook
nextnextapp/**/{page,layout,loading,error,global-error,not-found,template,default,route,opengraph-image,twitter-image,icon,apple-icon,sitemap,robots,manifest}.*
src/app/**/{page,layout,loading,error,global-error,not-found,template,default,route,opengraph-image,twitter-image,icon,apple-icon,sitemap,robots,manifest}.*
pages/**
src/pages/**
{src/,}middleware.*
{src/,}instrumentation.*
next.config.*
@next/*
eslint-config-next
remix@remix-run/dev
@remix-run/react
app/routes/**
app/root.*
app/entry.client.*
app/entry.server.*
remix.config.*
@remix-run/*
react-router@react-router/devapp/routes/**
app/routes.*
app/root.*
app/entry.client.*
app/entry.server.*
react-router.config.*
@react-router/*
astroastrosrc/pages/**
src/content/**
src/content.config.*
src/middleware.*
src/actions/**
astro.config.*
@astrojs/*
sveltekit@sveltejs/kitsrc/routes/**
src/hooks.*
src/hooks.*.*
src/params/**
svelte.config.*
vite.config.*
@sveltejs/*
nuxtnuxtpages/**
layouts/**
middleware/**
plugins/**
server/**
components/**
composables/**
utils/**
stores/**
app.vue
error.vue
nuxt.config.*
@nuxt/*
vitevitevite.config.*@vitejs/*
webpackwebpackwebpack.config.*
webpack.*.config.*
*-loader
webpack-cli
webpack-dev-server
rolluprolluprollup.config.*@rollup/*
rolldownrolldownrolldown.config.*–
tsuptsuptsup.config.*–
tsdowntsdowntsdown.config.*–
eslinteslinteslint.config.*@eslint/*
@typescript-eslint/*
typescript-eslint
eslint-*
prettierprettierprettier.config.*@prettier/*
prettier-plugin-*
oxlintoxlintoxlint.config.*–
postcsspostcss
tailwindcss
postcss.config.*
tailwind.config.*
autoprefixer
cssnano
postcss-*
@tailwindcss/*
babel@babel/corebabel.config.*@babel/*
babel-*
docusaurus@docusaurus/coredocusaurus.config.*
sidebars.*
src/pages/**
src/theme/**
@docusaurus/*
vitepressvitepress.vitepress/config.*
.vitepress/theme/**
docs/.vitepress/config.*
docs/.vitepress/theme/**
–
expoexpoapp/**
app.config.*
metro.config.*
expo-*
@expo/*