Tern Node Lint
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript maintenance
Tern plugin adding validation for Node.js require() statements. Version 0.1.0 (probably outdated, last release unknown). Integrates with Tern code intelligence to lint require module paths. Depends on tern and node plugins. Minimal maintenance; no updates since early 2015. Alternative: use TypeScript or ESLint with import/no-unresolved for require validation.
Common errors
error Error: Cannot find module 'tern-node-lint' ↓
cause Not installed or misplaced in node_modules
fix
Run 'npm install tern-node-lint' in the project root.
error TypeError: tern.loadPlugin is not a function ↓
cause No such method; plugins are registered via tern.registerPlugin
fix
Use 'tern.registerPlugin('node-lint', require('tern-node-lint'))'
error Plugin 'node-lint' is not loaded ↓
cause Missing in .tern-project or programmatic registration
fix
Add 'node-lint' to plugins in .tern-project.
Warnings
deprecated Package has no releases since 0.1.0 (2015). Tern ecosystem is mostly unmaintained. ↓
fix Switch to TypeScript or ESLint for require validation.
gotcha Requires both 'node' and 'lint' plugins to be enabled; order matters. ↓
fix Add plugins in order: node, lint, node-lint.
breaking Breaking changes in Tern 0.12+ may cause plugin incompatibility. ↓
fix Pin Tern to 0.11 or earlier.
Install
npm install tern-node-lint yarn add tern-node-lint pnpm add tern-node-lint Imports
- plugin (via .tern-project) wrong
npm install tern-node-lint --globalcorrect{"plugins":{"node-lint":{}}} - require('tern-node-lint') wrong
import ternNodeLint from 'tern-node-lint';correctconst ternNodeLint = require('tern-node-lint'); - Tern plugin registration wrong
tern.loadPlugin('node-lint'); // method does not existcorrectconst tern = require('tern'); tern.registerPlugin('node-lint', require('tern-node-lint'));
Quickstart
// .tern-project
{
"plugins": {
"node": {},
"lint": {},
"node-lint": {}
},
"libs": ["browser"]
}
// Install
$ npm install tern tern-node-lint
// Run Tern server with project
$ tern --port 8080