{"id":19304,"library":"babel-preset-jsy","title":"babel-preset-jsy","description":"Babel preset for JSY, an indentation-based (offside) JavaScript syntax dialect that uses Python-like indentation instead of braces. This preset builds on babel-preset-env and supports Babel 6.x. It compiles JSY into standard JavaScript with automatic transpilation based on environment. The latest version is 0.15.3, with maintenance updates as needed. Unlike other indentation-based syntaxes such as CoffeeScript or LiveScript, JSY aims to stay close to standard JavaScript semantics while providing clean, whitespace-sensitive code. Current status is maintenance as JSY has limited adoption.","status":"maintenance","version":"0.15.3","language":"javascript","source_language":"en","source_url":"https://github.com/jsy-lang/babel-preset-jsy","tags":["javascript","babel","syntax","offside","python","indention","indent"],"install":[{"cmd":"npm install babel-preset-jsy","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-jsy","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-jsy","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for automatic target environment transpilation","package":"babel-preset-env","optional":false},{"reason":"Plugin that transforms JSY indentation-based syntax to standard JavaScript","package":"babel-plugin-jsy","optional":false}],"imports":[{"note":"This is a Babel preset, not a JavaScript module. Use the preset name in Babel configuration as a string. 'jsy/lean' refers to a preset file inside the package.","wrong":"import { jsy } from 'babel-preset-jsy'","symbol":"jsy","correct":"module.exports = { presets: ['jsy/lean'] }"},{"note":"In Babel 6, presets are specified as strings in .babelrc or babel config. Doing 'require' returns an object, but Babel expects a function.","wrong":"require('babel-preset-jsy')","symbol":"babel-preset-jsy","correct":"const presets = ['babel-preset-jsy']"},{"note":"The 'jsy/lean' preset is a variant that only transforms JSY syntax without additional polyfills or env targets.","wrong":"","symbol":"jsy/lean","correct":"const presets = ['jsy/lean']"}],"quickstart":{"code":"// Install: npm install --save-dev babel-preset-jsy\n// .babelrc configuration:\n{\n  \"presets\": [\"jsy/lean\"]\n}\n\n// Example JSY code (file.jsy)\n// Indentation-based syntax\nconst add = (a, b) =>\n  a + b\n\nfor (let i = 0; i < 10; i++)\n  console.log(i)\n\nif (true)\n  console.log('true')\nelse\n  console.log('false')\n\n// Compile with: babel file.jsy","lang":"javascript","description":"Configures Babel with the jsy/lean preset and shows a sample JSY code snippet using indentation instead of braces."},"warnings":[{"fix":"For Babel 7, consider using babel-plugin-jsy directly or look for updated presets.","message":"This package is designed for Babel 6.x and may not work with Babel 7+.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Update your .babelrc: change \"presets\": [\"jsy\"] to \"presets\": [\"jsy/lean\"].","message":"Version 0.10.0 changed the preset name from 'jsy' to 'jsy/lean'.","severity":"breaking","affected_versions":">=0.10.0 <0.11.0"},{"fix":"Use file extensions like .jsy or configure Babel to only transform JSY files if possible.","message":"JSY syntax may conflict with standard JavaScript when used in mixed codebases.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use babel-plugin-jsy with proper configuration to handle mixed syntax, or separate files.","message":"Cannot use both JSY and standard JavaScript in the same file without explicit transformation.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Upgrade to a Babel 7 compatible preset or downgrade Babel to version 6.","cause":"Using babel-preset-jsy with Babel 7 or later.","error":"Error: Requires Babel \"^6.0.0-0\" but was loaded with \"7.x.x\"."},{"fix":"Change preset to 'babel-preset-jsy/lean' or 'jsy/lean' depending on your setup.","cause":"Incorrect path in preset configuration.","error":"Error: Cannot find module 'babel-preset-jsy/lean'"},{"fix":"Add 'jsy/lean' to presets in your Babel config.","cause":"Babel not configured to use the JSY preset.","error":"SyntaxError: Unexpected token (1:6) - using indentation"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}