{"id":25747,"library":"ilib-lint-javascript","title":"iLib Lint JavaScript Plugin","description":"An ilib-lint plugin providing rules and rulesets for linting localized string resources extracted from JavaScript files. Current stable version is 1.1.1, released as part of the ilib-mono repository. It checks ilib-style plural syntax and plural categories for target locales, enforcing correct resource formatting in JavaScript/i18n projects. Requires Node.js >=12 and is ESM-only. The plugin integrates via ilib-lint configuration and is designed for use within iLib localization toolchains.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/iLib-js/ilib-mono","tags":["javascript"],"install":[{"cmd":"npm install ilib-lint-javascript","lang":"bash","label":"npm"},{"cmd":"yarn add ilib-lint-javascript","lang":"bash","label":"yarn"},{"cmd":"pnpm add ilib-lint-javascript","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail.","wrong":"const plugin = require('ilib-lint-javascript')","symbol":"default","correct":"import plugin from 'ilib-lint-javascript'"},{"note":"If the package exports a Rules object; check actual exports.","wrong":"","symbol":"Rules","correct":"import { Rules } from 'ilib-lint-javascript'"},{"note":"If exported as a named function, default import is incorrect.","wrong":"import createPlugin from 'ilib-lint-javascript'","symbol":"plugin as a function","correct":"import { createPlugin } from 'ilib-lint-javascript'"}],"quickstart":{"code":"// Install: npm install --save-dev ilib-lint-javascript\n// ilib-lint-config.json\n{\n  \"plugins\": [\"ilib-lint-javascript\"],\n  \"rulesets\": {\n    \"recommended\": [\n      \"resource-ilib-plural-syntax-checker\",\n      \"resource-ilib-plural-categories-checker\"\n    ]\n  }\n}","lang":"javascript","description":"Configures ilib-lint to use the JavaScript plugin with plural rules."},"warnings":[{"fix":"Use Node.js >=12 and import with ESM syntax.","message":"ESM-only: Node.js <12 or usage with require() will fail.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade to Node.js >=18.","message":"Node.js 12 and 14 are end-of-life; future versions may drop support.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure \"plugins\" array contains exactly \"ilib-lint-javascript\".","message":"Plugin must be added to ilib-lint-config.json under plugins array; missing or misnamed will not load.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use ilib-lint with appropriate file type plugins to extract resources.","message":"Rules only apply to resource files (e.g., XLIFF, JSON), not raw JS source code.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Convert plural strings to ilib syntax before linting.","message":"Plural syntax checker expects ilib-style plural strings; ICU or other formats will be flagged as errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.1':27 '12':59 'categori':46 'check':38 'configur':72 'correct':51 'current':23 'design':75 'enforc':50 'esm':63 'esm-on':62 'extract':19 'file':22 'format':53 'ilib':1,7,34,40,70,79 'ilib-lint':6,69 'ilib-mono':33 'ilib-styl':39 'integr':67 'javascript':3,21,82 'javascript/i18n':55 'lint':2,8,15,71 'local':16,49,80 'mono':35 'node.js':58 'part':30 'plugin':4,9,66 'plural':42,45 'project':56 'provid':10 'releas':28 'repositori':36 'requir':57 'resourc':18,52 'rule':11 'ruleset':13 'stabl':24 'string':17 'style':41 'syntax':43 'target':48 'toolchain':81 'use':77 'version':25 'via':68 'within':78","created_at":"2026-05-01T13:46:21.693038+00:00","updated_at":"2026-05-01T13:46:21.693038+00:00","problems":[{"fix":"Change to import statement or set { \"type\": \"module\" } in package.json.","cause":"Using require() to load an ESM-only module.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Run 'npm install --save-dev ilib-lint-javascript'.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'ilib-lint-javascript'"},{"fix":"Verify plugin is in ilib-lint-config.json plugins array and rule name is correct.","cause":"Plugin not loaded or rule name misspelled in configuration.","error":"Unknown rule: resource-ilib-plural-syntax-checker"},{"fix":"Check export structure; use correct import syntax.","cause":"Plugin imported incorrectly (default import when expecting named export).","error":"TypeError: plugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/iLib-js/ilib-mono","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ilib-lint-javascript","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}