Registry / testing / brslint

brslint

JSON →
library0.2.3jsnpmunverified

Brslint is a parsing and linting tool for Roku's BrightScript language. The current stable version is 0.2.3, released as a maintenance update with support for try/throw/catch syntax from OS 9.4. It provides static analysis for BrightScript files, including validation of component XML files, customizable rules via brslint.config, and over 30 built-in rules. Unlike generic linters, it is purpose-built for BrightScript and integrates with Roku development workflows. Release cadence is irregular, with updates approximately every 2-6 months. Key differentiators: native support for BrightScript syntax, configurable rule sets, and XML component validation.

npm install brslint
INSTALL
IMPORT
SIG · BRSLINT
B
brslint
testingjavascriptv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Linter
import { Linter } from 'brslint';
const Linter = require('brslint');
The package is ESM-only (engines: node >=8.0.0), but dynamic import works in CJS contexts.
default
import brslint from 'brslint';
const brslint = require('brslint').default;
Default export is available; do not add .default in require.
Rule
import { Rule } from 'brslint';
import Rule from 'brslint';
Named export for type rules; not a default export.

Shows how to create a Linter instance, configure it with custom rules, and lint individual files or directories.

import brslint from 'brslint'; const linter = new brslint.Linter(); // Configure rules linter.config({ rules: { include: ['no_empty_then', 'no_empty_else'] } }); // Lint a file const result = linter.lint('source/main.brs'); console.log(result.warnings); // Or lint a directory const dirResult = linter.lint('source/'); console.log(dirResult.warnings);
brslint --version
Debug
Known issues
breakingIn v0.2.0, the configuration format changed from inline JSON to brslint.config file; existing configs may not be compatible.
fix
Migrate to brslint.config format as described in the README.
affects: <0.2.0
deprecatedThe rule 'no_tab' is deprecated in v0.1.8; use 'indentation' instead.
fix
Replace 'no_tab' with 'indentation' in your rules configuration.
affects: >=0.1.8
gotchaBrslint only lints *.brs files; other file extensions are ignored silently.
fix
Ensure your BrightScript files have the .brs extension.
affects: >=0.1.0
gotchaWhen using a brslint.config file, all paths are relative to the config file's location, not the current working directory.
fix
Use paths relative to the config file directory.
affects: >=0.1.7
Errors
Common errors & fixes
Error: Cannot find module 'nearley'
Missing peer dependency nearley which is required for parsing.
fix
Install nearley: npm install nearley
SyntaxError: Unexpected token (1:1) while parsing...
Brslint does not support newer BrightScript syntax introduced after OS 9.4 (e.g., interfaces).
fix
Update brslint to a version that supports the syntax, or avoid using unsupported features.
TypeError: Linter is not a constructor
Attempting to use CommonJS require incorrectly with the ESM package.
fix
Use dynamic import: import('brslint').then(m => { const linter = new m.Linter(); })
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
nearleyrequiredUsed for parsing BrightScript grammar
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
brslint — npm install brslint · libregistry