提交 5a96f231 编写于 作者: M Matt Bierner

Enable ts-check

上级 019f23ed
......@@ -2,6 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// @ts-check
'use strict';
var updateGrammar = require('../../../build/npm/update-grammar');
......@@ -18,10 +19,10 @@ function removeDom(grammar) {
function adaptToJavaScript(grammar, replacementScope) {
grammar.name = 'JavaScript (with React support)';
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs' ];
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs'];
grammar.scopeName = `source${replacementScope}`;
var fixScopeNames = function(rule) {
var fixScopeNames = function (rule) {
if (typeof rule.name === 'string') {
rule.name = rule.name.replace(/\.tsx/g, replacementScope);
}
......@@ -47,8 +48,3 @@ updateGrammar.update(tsGrammarRepo, 'TypeScript.tmLanguage', './syntaxes/TypeScr
updateGrammar.update(tsGrammarRepo, 'TypeScriptReact.tmLanguage', './syntaxes/TypeScriptReact.tmLanguage.json', grammar => removeDom(grammar));
updateGrammar.update(tsGrammarRepo, 'TypeScriptReact.tmLanguage', '../javascript/syntaxes/JavaScript.tmLanguage.json', grammar => adaptToJavaScript(removeDom(grammar), '.js'));
updateGrammar.update(tsGrammarRepo, 'TypeScriptReact.tmLanguage', '../javascript/syntaxes/JavaScriptReact.tmLanguage.json', grammar => adaptToJavaScript(removeDom(grammar), '.js.jsx'));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册