{"id":25035,"library":"brslint","title":"brslint","description":"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.","status":"active","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/nbcnews/brslint","tags":["javascript","brightscript","lint"],"install":[{"cmd":"npm install brslint","lang":"bash","label":"npm"},{"cmd":"yarn add brslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add brslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for parsing BrightScript grammar","package":"nearley","optional":false}],"imports":[{"note":"The package is ESM-only (engines: node >=8.0.0), but dynamic import works in CJS contexts.","wrong":"const Linter = require('brslint');","symbol":"Linter","correct":"import { Linter } from 'brslint';"},{"note":"Default export is available; do not add .default in require.","wrong":"const brslint = require('brslint').default;","symbol":"default","correct":"import brslint from 'brslint';"},{"note":"Named export for type rules; not a default export.","wrong":"import Rule from 'brslint';","symbol":"Rule","correct":"import { Rule } from 'brslint';"}],"quickstart":{"code":"import brslint from 'brslint';\n\nconst linter = new brslint.Linter();\n// Configure rules\nlinter.config({\n  rules: {\n    include: ['no_empty_then', 'no_empty_else']\n  }\n});\n\n// Lint a file\nconst result = linter.lint('source/main.brs');\nconsole.log(result.warnings);\n\n// Or lint a directory\nconst dirResult = linter.lint('source/');\nconsole.log(dirResult.warnings);","lang":"javascript","description":"Shows how to create a Linter instance, configure it with custom rules, and lint individual files or directories."},"warnings":[{"fix":"Migrate to brslint.config format as described in the README.","message":"In v0.2.0, the configuration format changed from inline JSON to brslint.config file; existing configs may not be compatible.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Replace 'no_tab' with 'indentation' in your rules configuration.","message":"The rule 'no_tab' is deprecated in v0.1.8; use 'indentation' instead.","severity":"deprecated","affected_versions":">=0.1.8"},{"fix":"Ensure your BrightScript files have the .brs extension.","message":"Brslint only lints *.brs files; other file extensions are ignored silently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use paths relative to the config file directory.","message":"When using a brslint.config file, all paths are relative to the config file's location, not the current working directory.","severity":"gotcha","affected_versions":">=0.1.7"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install nearley: npm install nearley","cause":"Missing peer dependency nearley which is required for parsing.","error":"Error: Cannot find module 'nearley'"},{"fix":"Update brslint to a version that supports the syntax, or avoid using unsupported features.","cause":"Brslint does not support newer BrightScript syntax introduced after OS 9.4 (e.g., interfaces).","error":"SyntaxError: Unexpected token (1:1) while parsing..."},{"fix":"Use dynamic import: import('brslint').then(m => { const linter = new m.Linter(); })","cause":"Attempting to use CommonJS require incorrectly with the ESM package.","error":"TypeError: Linter is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}