lunte

Self-contained linter for Pear/Bare projects

Apache-2.0 20 个版本
安装
npm install lunte
yarn add lunte
pnpm add lunte
bun add lunte
README

Lunte

A self-contained JavaScript linter, mostly matching non-formatting rules of Standard.

Installation

npm install --save-dev lunte

Usage

lunte [optional: dir or glob]

Globs are supported:

lunte "src/**/*.js"

By default Lunte skips node_modules/. Manage additional exclusions with .lunteignore (gitignore-style patterns).

Files ending in .json are also linted. Lunte treats them as strict JSON, so invalid syntax is reported and structural rules such as no-dupe-keys still apply.

Configuration

Configuration is optional, but when needed create a .lunterc (or .lunterc.json) at the project root.

{
  "env": ["node"],
  "globals": ["MY_APP"],
  "plugins": ["lunte-plugin-pear"],
  "rules": {
    "no-undef": "off",
    "pear/no-apples": "error"
  },
  "disableHolepunchGlobals": true
}
  • env enables preset global sets (node, browser, es2021).
  • globals adds project-specific globals.
  • rules sets severities per rule ("off", "warn", "error", or 0/1/2).
  • disableHolepunchGlobals skips adding Pear/Bare globals.

Command-line overrides are available for ad-hoc runs:

lunte --env browser --global Pear --rule no-unused-vars=off src/

TypeScript

  • Experimental parser is bundled via vendored @sveltejs/acorn-typescript; no extra install needed.
  • Files ending .ts, .tsx, .mts, .cts, .d.ts (and .jsx when present) automatically switch to the TS parser.
  • Type-aware handling currently exists for no-undef and no-unused-vars; other rules run without type checking.

Plugins

Load third-party rule packs by listing module IDs under plugins. Each plugin should export a rules array (or object) of rule definitions with unique meta.name values.

{
  "plugins": ["./rules/lunte-plugin-pear.js", "lunte-plugin-pear"],
  "rules": {
    "pear/no-apples": "error"
  }
}

For ad-hoc runs, lunte --plugin lunte-plugin-pear --plugin ./rules/lunte-plugin-pear.js src/ applies the same modules.

Inline Ignores

const cached = maybeUndefined() // lunte-disable-line no-undef

// lunte-disable-next-line
useGlobalResource()
  • lunte-disable-line suppresses the listed rules, or all rules when none are listed, on the same line.
  • lunte-disable-next-line applies to the following line.
  • eslint-disable-* directives are also supported for compatibility.

Editor Integration

Lunte ships with a separate LSP package: lunte-lsp.

Repository

Monorepo: https://github.com/holepunchto/lunte

lunte

License

Apache-2.0

版本列表
1.8.4 2026-07-03
1.8.3 2026-06-30
1.8.2 2026-06-24
1.8.1 2026-06-23
1.8.0 2026-04-27
1.7.0 2026-04-15
1.6.0 2026-02-02
1.5.0 2026-01-29
1.4.0 2025-11-27
1.3.0 2025-11-06
1.2.0 2025-11-04
1.1.0 2025-11-03
1.0.2 2025-10-29
1.0.1 2025-10-28
1.0.0 2025-10-21
0.2.3 2025-10-13
0.2.2 2025-10-13
0.2.1 2025-10-13
0.2.0 2025-10-10
0.1.0 2025-10-09