{"name":"lunte","version":"0.2.2","keywords":[],"author":{"name":"Mikkel Malmberg","email":"mikkel@holepunch.to"},"license":"Apache-2.0","_id":"lunte@0.2.2","maintainers":[{"name":"mikker","email":"mikkel@brnbw.com"}],"bin":{"lunte":"bin/lunte"},"dist":{"shasum":"d499e19fb7fdf73fab876a87bbf287840e3f1f69","tarball":"http://registry-npm.ywwl.com/lunte/download/lunte-0.2.2.tgz","fileCount":98,"integrity":"sha512-hXrxbA9F4yKbSb9fbRRax77q1G9y3yYxDcDVJ9pqHJx7cayPngc9d8sXT8ZsbEUZ5wWHkui5/etzvN3H6R7aSA==","signatures":[{"sig":"MEUCIGvc79BvQ1y632mRO2EYZl5LAcB8Rda+xZRvf77SF9xvAiEAjS2IFwx3rWjkatmAmX5Dcw+7FqRieNVhfrcvRBpFOn0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":688242,"size":161099,"noattachment":false,"key":"/lunte/-/lunte-0.2.2.tgz"},"main":"./src/index.js","type":"module","gitHead":"58162223a5ac0dfe37c2882af10fc35421ca92f5","scripts":{"lint":"lunte .","test":"brittle \"test/**/*.test.js\"","format":"prettier . --write","vendor:acorn":"node scripts/vendor-acorn.js"},"_npmUser":{"name":"mikker","email":"mikkel@brnbw.com"},"_npmVersion":"11.6.2","description":"Self-contained linter","directories":{},"_nodeVersion":"24.9.0","dependencies":{"paparam":"^1.8.6"},"_hasShrinkwrap":false,"devDependencies":{"brittle":"^3.19.0"},"_npmOperationalInternal":{"tmp":"tmp/lunte_0.2.2_1760358579345_0.2064368089980193","host":"s3://npm-registry-packages-npm-production"},"readme":"# Lunte\n\nA self-contained JavaScript linter, mostly matching non-formatting rules of Standard.\n\n## Installation\n\n```sh\nnpm install --save-dev lunte\n```\n\n## Usage\n\n```sh\nlunte [optional: dir or glob]\n```\n\nGlobs are supported:\n\n```sh\nlunte \"src/**/*.js\"\n```\n\nBy default Lunte skips `node_modules/`. Manage additional exclusions with `.lunteignore` (gitignore-style patterns).\n\nFiles 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.\n\n## Configuration\n\nConfiguration is optional, but when needed create a `.lunterc` (or `.lunterc.json`) at the project root.\n\n```json\n{\n  \"env\": [\"node\"],\n  \"globals\": [\"MY_APP\"],\n  \"plugins\": [\"lunte-plugin-pear\"],\n  \"rules\": {\n    \"no-undef\": \"off\",\n    \"pear/no-apples\": \"error\"\n  },\n  \"disableHolepunchGlobals\": true\n}\n```\n\n- `env` enables preset global sets (`node`, `browser`, `es2021`).\n- `globals` adds project-specific globals.\n- `rules` sets severities per rule (`\"off\"`, `\"warn\"`, `\"error\"`, or `0/1/2`), optionally with options (see [Rule Options](#rule-options)).\n- `disableHolepunchGlobals` skips adding `Pear`/`Bare` globals.\n\nCommand-line overrides are available for ad-hoc runs:\n\n```sh\nlunte --env browser --global Pear --rule no-unused-vars=off src/\n```\n\nLunte exits with code 1 when any error is reported; warnings alone exit 0. To cap the number of warnings (e.g. while a `\"warn\"` rule is being cleaned up), pass `--max-warnings <n>`: the run fails when more than `n` warnings are reported, and `--max-warnings 0` fails on any warning. The limit is CLI-only and cannot be set in `.lunterc`.\n\n```sh\nlunte --max-warnings 10 src/\n```\n\n## TypeScript\n\n- Experimental parser is bundled via vendored `@sveltejs/acorn-typescript`; no extra install needed.\n- Files ending `.ts`, `.tsx`, `.mts`, `.cts`, `.d.ts` (and `.jsx` when present) automatically switch to the TS parser.\n- Type-aware handling currently exists for `no-undef` and `no-unused-vars`; other rules run without type checking.\n\n## Plugins\n\nLoad 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.\n\n```json\n{\n  \"plugins\": [\"./rules/lunte-plugin-pear.js\", \"lunte-plugin-pear\"],\n  \"rules\": {\n    \"pear/no-apples\": \"error\"\n  }\n}\n```\n\nFor ad-hoc runs, `lunte --plugin lunte-plugin-pear --plugin ./rules/lunte-plugin-pear.js src/` applies the same modules.\n\n## Rule Options\n\nA rule entry can be a severity or, as in ESLint, an array of a severity followed by any number of options:\n\n```json\n{\n  \"rules\": {\n    \"no-undef\": \"error\",\n    \"pear/max-lines\": [\"warn\", { \"max\": 60 }]\n  }\n}\n```\n\nAn entry with a severity only (`\"warn\"` or `[\"warn\"]`) keeps the options set before it, so `--rule pear/max-lines=error` changes the severity without dropping `{ \"max\": 60 }`. The `--rule` flag itself takes severities only.\n\nRules read their options from `context.options`, an array that is `[]` when none are configured. A rule can declare `meta.defaultOptions`, and, as in ESLint, configured options are merged into them recursively: objects merge key by key, arrays and other values replace the default, and anything left out keeps its default.\n\n```js\nexport default {\n  rules: [\n    {\n      meta: { name: 'pear/max-lines', defaultOptions: [{ max: 40 }] },\n      create(context) {\n        const { max } = context.options[0]\n        return {\n          Program(node) {\n            const lines = context.source.trimEnd().split('\\n').length\n            if (lines > max) {\n              context.report({ node, message: `File has ${lines} lines, maximum is ${max}.` })\n            }\n          }\n        }\n      }\n    }\n  ]\n}\n```\n\n## Inline Ignores\n\n```js\nconst cached = maybeUndefined() // lunte-disable-line no-undef\n\n// lunte-disable-next-line\nuseGlobalResource()\n```\n\n- `lunte-disable-line` suppresses the listed rules, or all rules when none are listed, on the same line.\n- `lunte-disable-next-line` applies to the following line.\n- `eslint-disable-*` directives are also supported for compatibility.\n\n## Editor Integration\n\nLunte ships with a separate LSP package: [`lunte-lsp`](https://www.npmjs.com/package/lunte-lsp).\n\n## Repository\n\nMonorepo: https://github.com/holepunchto/lunte\n\n![lunte](https://raw.githubusercontent.com/holepunchto/lunte/main/docs/lunte.webp)\n\n## License\n\nApache-2.0\n","publish_time":1760358579566,"_cnpm_publish_time":1760358579566,"dist-tags":{"latest":"1.8.6"}}