{"id":41877,"library":"righteous","title":"Righteous","description":"Righteous is a Kary Foundation coding style based code formatter for TypeScript and JavaScript, using TypeScript's own compiler service APIs. It enforces Kary Foundation's indentation and spacing policies. This package is version 1.1.3 with no major updates since its initial release. It is primarily intended for use within Kary Foundation's IDEs and editors, not as a general-purpose formatter like Prettier. The package ships with TypeScript declaration files but lacks active maintenance.","status":"maintenance","version":"1.1.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install righteous","lang":"bash","label":"npm"},{"cmd":"yarn add righteous","lang":"bash","label":"yarn"},{"cmd":"pnpm add righteous","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Righteous uses TypeScript's compiler service to parse and format TypeScript/JavaScript. It requires the TypeScript package to be installed as a peer dependency.","package":"typescript","optional":false}],"imports":[{"note":"The library is ESM-first and uses a single default export of a function.","wrong":"const righteous = require('righteous')","symbol":"righteous","correct":"import righteous from 'righteous'"},{"note":"This is a named type export, not a default export. Use named import for TypeScript options type.","wrong":"import RighteousOptions from 'righteous'","symbol":"RighteousOptions","correct":"import { RighteousOptions } from 'righteous'"},{"note":"The library also exports a named function 'format' for explicit usage, but the default export is the same function.","wrong":"import format from 'righteous'","symbol":"format","correct":"import { format } from 'righteous'"}],"quickstart":{"code":"import righteous from 'righteous';\n// Or CommonJS: const righteous = require('righteous').default;\n\nconst sourceCode = `function hello) { return;`;\nconst formatted = righteous(sourceCode, {\n  // Options can include: indentSize, tabChar, etc.\n  indentSize: 2,\n});\nconsole.log(formatted);\n// Output: function hello() { return; }\n","lang":"typescript","description":"Shows basic usage: import the formatter, call it with source code and optional options, and get formatted output."},"warnings":[{"fix":"Install TypeScript in your project: npm install typescript","message":"Requires TypeScript as a peer dependency. Not installing TypeScript will cause a runtime error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider using a modern formatter like Prettier for long-term maintenance.","message":"The package uses deprecated TypeScript compiler APIs (Compiler API). Future versions of TypeScript may break compatibility.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use ESM imports or const righteous = require('righteous').default;","message":"Default export is a function, but CommonJS require returns an object with a 'default' property. Using const righteous = require('righteous') will result in righteous being an object, not a function.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.3':36 'activ':76 'api':22 'base':9 'code':7,10 'compil':20 'declar':72 'editor':57 'enforc':24 'file':73 'formatt':11,64 'foundat':6,26,53 'general':62 'general-purpos':61 'ide':55 'indent':28 'initi':43 'intend':48 'javascript':15,78 'kari':5,25,52 'lack':75 'like':65 'mainten':77 'major':39 'packag':33,68 'polici':31 'prettier':66 'primarili':47 'purpos':63 'releas':44 'righteous':1,2 'servic':21 'ship':69 'sinc':41 'space':30 'style':8 'typescript':13,17,71 'updat':40 'use':16,50 'version':35 'within':51","created_at":"2026-06-04T18:54:32.485921+00:00","updated_at":"2026-06-04T18:54:32.485921+00:00","problems":[{"fix":"Use import righteous from 'righteous' (ESM) or const righteous = require('righteous').default;","cause":"In CommonJS (Node.js), require('righteous') returns an object with a 'default' property; the function is not directly the require result.","error":"TypeError: righteous is not a function"},{"fix":"Run npm install typescript","cause":"TypeScript is a peer dependency and not installed automatically.","error":"Cannot find module 'typescript'"},{"fix":"Ensure righteous is installed and referenced in tsconfig.json. If needed, add reference: /// <reference path=\"node_modules/righteous/typings/righteous.d.ts\" />","cause":"The TypeScript declaration file path is not resolved correctly or the module is not installed.","error":"error TS2307: Cannot find module 'righteous'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"righteous","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}