{"id":25746,"library":"ilib-lint-apple","title":"ilib-lint-apple","description":"A plugin for ilib-lint that validates Apple platform string parameters, specifically ensuring Swift string interpolation placeholders like \\(name) are correctly preserved in translated targets. Version 1.0.1 is current, with node.js 14+ and ESM support required. Unlike generic string linters, it targets Apple ecosystem files and provides a dedicated 'resource-swift-params' rule along with an 'apple' ruleset for easy integration into XLIFF file type checking.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","ilib","lint","apple","swift","objective-c","localization","i18n"],"install":[{"cmd":"npm install ilib-lint-apple","lang":"bash","label":"npm"},{"cmd":"yarn add ilib-lint-apple","lang":"bash","label":"yarn"},{"cmd":"pnpm add ilib-lint-apple","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core linting framework; plugin is designed to extend ilib-lint functionality","package":"ilib-lint","optional":false}],"imports":[{"note":"The plugin is exported as default; no named exports are provided.","symbol":"plugin","correct":"import plugin from 'ilib-lint-apple'"},{"note":"Rule classes are named exports; do not use default import.","wrong":"import ResourceSwiftParamsRule from 'ilib-lint-apple'","symbol":"ResourceSwiftParamsRule","correct":"import { ResourceSwiftParamsRule } from 'ilib-lint-apple'"},{"note":"Rule sets are also named exports.","symbol":"AppleRuleSet","correct":"import { AppleRuleSet } from 'ilib-lint-apple'"}],"quickstart":{"code":"// Install: npm install --save-dev ilib-lint-apple\n// In ilib-lint-config.json:\n{\n  \"plugins\": [\"ilib-lint-apple\"],\n  \"filetypes\": {\n    \"xliff\": {\n      \"ruleset\": [\"apple\"]\n    }\n  }\n}\n// Run: npx ilib-lint check -f xliff translations.xliff","lang":"json","description":"Shows how to install and configure the plugin to validate Swift string parameters in XLIFF files."},"warnings":[{"fix":"Use import syntax or set type: 'module' in package.json. Alternatively, upgrade to Node 14+.","message":"Plugin requires node.js 14+ and ESM module system. CJS require() will not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For Objective-C format specifiers, use additional rules from other plugins or configure ilib-lint's built-in format checking.","message":"The rule 'resource-swift-params' only checks for Swift-style interpolation \\(param). Other placeholders (e.g., %@) are not validated.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ignore false positives via ilib-lint's inline suppression comments like // eslint-disable-next-line or resource-level ignore flags.","message":"Plugin may produce false positives for strings containing literal \\(... ) that are not Swift interpolation (e.g., in code comments).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change project to ESM (type: 'module' in package.json) or use dynamic import(). Ensure node version >=14.","cause":"Using require() on an ESM-only module; ilib-lint-apple is ESM, but project may use CommonJS.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/ilib-lint-apple/index.js from /path/to/project/ilib-lint-config.json not supported."},{"fix":"Add 'ruleset': ['apple'] under the appropriate filetype in ilib-lint-config.json.","cause":"Plugin loaded but rule set not enabled for the file type.","error":"Parsing error: The 'resource-swift-params' rule is not configured."},{"fix":"Reinstall ilib-lint-apple and ensure ilib-lint is up-to-date. Run npm install --save-dev ilib-lint-apple@latest.","cause":"Corrupted or mismatched plugin version. Possibly the plugin not properly loaded or incompatible with ilib-lint version.","error":"TypeError: Cannot read properties of undefined (reading 'swiftParams')"},{"fix":"Run npm install --save-dev ilib-lint-apple and verify the package is in package.json devDependencies.","cause":"Plugin missing from node_modules or not listed in plugins array.","error":"Error: Plugin 'ilib-lint-apple' not found. Did you install it?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}