{"name":"@codemirror/lang-javascript","version":"6.0.0","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"license":"MIT","_id":"@codemirror/lang-javascript@6.0.0","maintainers":[{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"marijn","email":"marijnh@gmail.com"}],"homepage":"https://github.com/codemirror/lang-javascript#readme","bugs":{"url":"https://github.com/codemirror/lang-javascript/issues"},"dist":{"shasum":"ae23b623456d333ca175f7f9801824426a113aed","tarball":"http://registry-npm.ywwl.com/@codemirror/lang-javascript/download/@codemirror/lang-javascript-6.0.0.tgz","fileCount":8,"integrity":"sha512-IQLfR+pgydwLxP3AQYOhjGfLWlAZz5SEH+M1tnUXVvp2+KZhn3iDTQX/7HZgoJ3w0oySKOxPjdq6jmkTCW6/sg==","signatures":[{"sig":"MEUCIQCPW4tEf9+di5G8MIxH3Hnpq66Kli1R8D+5Xg8jB3JXfQIgQanaLfzXpflzRl2So+FqF/i8NSv/zBabFVzkxsp9jJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioEr4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqnA//bcqu+X2qulf9sPKaOX60hn2tnBP3wRhA0d+M+4XUzDNmBMlS\r\ny1vioKb7O0vU8u4vzszmHuMn3qJktw9HS/k1ZnesCgaAy+WqBI6DPXiJpm3e\r\nKvZlODo5b2csxqMs2Uqy+qOamtsLzQNwpK3qh3PFac4gjsBgR3FUInm6+n3w\r\nYKIskw7V02ciyLrrD51b+pNjjRqbSzLHBM+712brH39Y0bEL3yOzh/7dxATo\r\n+7ceb366C8N2qHW3AN5iJRu8xmgifAGYnJyjPjMO8ujssoSIvTduXQXNc1xq\r\noeaatxJ2EJO9Yp1ITPOCIGaYwKudmPt/loAa7dQICL8KsNYOVSoRVAB0292D\r\noRqHFf3ZpgcUK0gW80lqsSMPpjsnGCD55mPej9674TaBMarkkR6m0Op/Lg77\r\nVWRGf/L4f8MldIb+krNdcJeUFVxb0P5Z4ghHP9fmYZshbhTylVlslYlwPK/G\r\n/qMkemGSH+lW9HlT4ruVNH1Ee9mFXd+2y10hDhWv+MxuDZ3KQtVxI81VRO90\r\nbLjcsiITMu3kVWBX7oWnDVFayTa+MkbN0VbVXjpz7d4FFwKrQEKkKf8bjWYt\r\n5xxklLLKUItQ8m9JpnvSGpfWr4LYxh+ctlIO3nBAKjrO8k3AXIU3ZpFFmJrg\r\nQIirsOM8gdb2PCDH1XtzS2i4G9ViDqFOizs=\r\n=k7r0\r\n-----END PGP SIGNATURE-----\r\n","size":8121,"noattachment":false,"key":"/@codemirror/lang-javascript/-/@codemirror/lang-javascript-6.0.0.tgz"},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"0d8b7a63b8d2b7b624ad55ad7742a3dae9dbe992","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/index.ts"},"_npmUser":{"name":"marijn","email":"marijnh@gmail.com"},"repository":{"url":"git+https://github.com/codemirror/lang-javascript.git","type":"git"},"_npmVersion":"8.10.0","description":"JavaScript language support for the CodeMirror code editor","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@lezer/common":"^1.0.0","@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@lezer/javascript":"^1.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@lezer/lr":"^1.0.0","@codemirror/buildhelper":"^0.1.5"},"_npmOperationalInternal":{"tmp":"tmp/lang-javascript_6.0.0_1654672119963_0.2907314659830491","host":"s3://npm-registry-packages"},"readme":"<!-- NOTE: README.md is generated from src/README.md -->\n\n# @codemirror/lang-javascript [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-javascript.svg)](https://www.npmjs.org/package/@codemirror/lang-javascript)\n\n[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-javascript/blob/main/CHANGELOG.md) ]\n\nThis package implements JavaScript language support for the\n[CodeMirror](https://codemirror.net/) code editor.\n\nThe [project page](https://codemirror.net/) has more information, a\nnumber of [examples](https://codemirror.net/examples/) and the\n[documentation](https://codemirror.net/docs/).\n\nThis code is released under an\n[MIT license](https://github.com/codemirror/lang-javascript/tree/main/LICENSE).\n\nWe aim to be an inclusive, welcoming community. To make that explicit,\nwe have a [code of\nconduct](http://contributor-covenant.org/version/1/1/0/) that applies\nto communication around the project.\n\n## Usage\n\n```javascript\nimport {EditorView, basicSetup} from \"codemirror\"\nimport {javascript} from \"@codemirror/lang-javascript\"\n\nconst view = new EditorView({\n  parent: document.body,\n  doc: `console.log(\"Hello world\")`,\n  extensions: [basicSetup, javascript()]\n})\n```\n\n## API Reference\n\n<dl>\n<dt id=\"user-content-javascript\">\n  <code><strong><a href=\"#user-content-javascript\">javascript</a></strong>(<a id=\"user-content-javascript^config\" href=\"#user-content-javascript^config\">config</a>&#8288;?: {jsx&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a>, typescript&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a>} = {}) → <a href=\"https://codemirror.net/docs/ref#language.LanguageSupport\">LanguageSupport</a></code></dt>\n\n<dd><p>JavaScript support. Includes <a href=\"#user-content-snippets\">snippet</a>\nand local variable completion.</p>\n</dd>\n<dt id=\"user-content-javascriptlanguage\">\n  <code><strong><a href=\"#user-content-javascriptlanguage\">javascriptLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>A language provider based on the <a href=\"https://github.com/lezer-parser/javascript\">Lezer JavaScript\nparser</a>, extended with\nhighlighting and indentation information.</p>\n</dd>\n<dt id=\"user-content-typescriptlanguage\">\n  <code><strong><a href=\"#user-content-typescriptlanguage\">typescriptLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>A language provider for TypeScript.</p>\n</dd>\n<dt id=\"user-content-jsxlanguage\">\n  <code><strong><a href=\"#user-content-jsxlanguage\">jsxLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>Language provider for JSX.</p>\n</dd>\n<dt id=\"user-content-tsxlanguage\">\n  <code><strong><a href=\"#user-content-tsxlanguage\">tsxLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>Language provider for JSX + TypeScript.</p>\n</dd>\n<dt id=\"user-content-autoclosetags\">\n  <code><strong><a href=\"#user-content-autoclosetags\">autoCloseTags</a></strong>: <a href=\"https://codemirror.net/docs/ref#state.Extension\">Extension</a></code></dt>\n\n<dd><p>Extension that will automatically insert JSX close tags when a <code>&gt;</code> or\n<code>/</code> is typed.</p>\n</dd>\n<dt id=\"user-content-snippets\">\n  <code><strong><a href=\"#user-content-snippets\">snippets</a></strong>: readonly <a href=\"https://codemirror.net/docs/ref#autocomplete.Completion\">Completion</a>[]</code></dt>\n\n<dd><p>A collection of JavaScript-related\n<a href=\"https://codemirror.net/docs/ref/#autocomplete.snippet\">snippets</a>.</p>\n</dd>\n<dt id=\"user-content-typescriptsnippets\">\n  <code><strong><a href=\"#user-content-typescriptsnippets\">typescriptSnippets</a></strong>: <a href=\"https://codemirror.net/docs/ref#autocomplete.Completion\">Completion</a>[]</code></dt>\n\n<dd><p>A collection of snippet completions for TypeScript. Includes the\nJavaScript <a href=\"#user-content-snippets\">snippets</a>.</p>\n</dd>\n<dt id=\"user-content-localcompletionsource\">\n  <code><strong><a href=\"#user-content-localcompletionsource\">localCompletionSource</a></strong>(<a id=\"user-content-localcompletionsource^context\" href=\"#user-content-localcompletionsource^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionResult\">CompletionResult</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>Completion source that looks up locally defined names in\nJavaScript code.</p>\n</dd>\n<dt id=\"user-content-completionpath\">\n  <code><strong><a href=\"#user-content-completionpath\">completionPath</a></strong>(<a id=\"user-content-completionpath^context\" href=\"#user-content-completionpath^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → {path: readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[], name: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>} | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>Helper function for defining JavaScript completion sources. It\nreturns the completable name and object path for a completion\ncontext, or null if no name/property completion should happen at\nthat position. For example, when completing after <code>a.b.c</code> it will\nreturn <code>{path: [&quot;a&quot;, &quot;b&quot;], name: &quot;c&quot;}</code>. When completing after <code>x</code>\nit will return <code>{path: [], name: &quot;x&quot;}</code>. When not in a property or\nname, it will return null if <code>context.explicit</code> is false, and\n<code>{path: [], name: &quot;&quot;}</code> otherwise.</p>\n</dd>\n<dt id=\"user-content-scopecompletionsource\">\n  <code><strong><a href=\"#user-content-scopecompletionsource\">scopeCompletionSource</a></strong>(<a id=\"user-content-scopecompletionsource^scope\" href=\"#user-content-scopecompletionsource^scope\">scope</a>: any) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionSource\">CompletionSource</a></code></dt>\n\n<dd><p>Defines a <a href=\"https://codemirror.net/docs/ref/#autocomplete.CompletionSource\">completion source</a> that\ncompletes from the given scope object (for example <code>globalThis</code>).\nWill enter properties of the object when completing properties on\na directly-named path.</p>\n</dd>\n<dt id=\"user-content-eslint\">\n  <code><strong><a href=\"#user-content-eslint\">esLint</a></strong>(<a id=\"user-content-eslint^eslint\" href=\"#user-content-eslint^eslint\">eslint</a>: any, <a id=\"user-content-eslint^config\" href=\"#user-content-eslint^config\">config</a>&#8288;?: any) → fn(<a id=\"user-content-eslint^returns^view\" href=\"#user-content-eslint^returns^view\">view</a>: <a href=\"https://codemirror.net/docs/ref#view.EditorView\">EditorView</a>) → <a href=\"https://codemirror.net/docs/ref#lint.Diagnostic\">Diagnostic</a>[]</code></dt>\n\n<dd><p>Connects an <a href=\"https://eslint.org/\">ESLint</a> linter to CodeMirror's\n<a href=\"https://codemirror.net/docs/ref/#lint\">lint</a> integration. <code>eslint</code> should be an instance of the\n<a href=\"https://eslint.org/docs/developer-guide/nodejs-api#linter\"><code>Linter</code></a>\nclass, and <code>config</code> an optional ESLint configuration. The return\nvalue of this function can be passed to <a href=\"https://codemirror.net/docs/ref/#lint.linter\"><code>linter</code></a>\nto create a JavaScript linting extension.</p>\n<p>Note that ESLint targets node, and is tricky to run in the\nbrowser. The\n<a href=\"https://github.com/UziTech/eslint-linter-browserify\">eslint-linter-browserify</a>\npackage may help with that (see\n<a href=\"https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js\">example</a>).</p>\n</dd>\n</dl>\n","publish_time":1654672120103,"_cnpm_publish_time":1654672120103,"dist-tags":{"latest":"6.2.5"}}