由于Warning,所有检查都失败了。RequireJS失败。使用 --force 继续

问题描述 投票:2回答:1

我不是一个普通的开发者。我只是想给它增加一个语言翻译的功能 选择2;翻译了默认的 src/js/select2/i18n/en.js 文件内容,创建了一个新文件,并将标签从英文改为非英文。提交拉取请求后,我看到All checks have failed,下面是CILinting result。

Run grunt compile lint
Running "requirejs:dist" (requirejs) task
Error: ENOENT: no such file or directory, open
'/home/runner/work/select2/select2/src/js/select2/i18n/en.js'
In module tree:
select2/core
select2/options
select2/defaults
Warning: RequireJS failed. Use --force to continue.

Aborted due to warnings.
##[error]Process completed with exit code 6.

CITests和CIMinification的结果也是一样的. 需要做什么才能让翻译文件成功合并.

github jquery-select2
1个回答
2
投票

构建你的第一个 拉动请求 失败,因为您的提交已经删除了 本PR中提到的 文件中提到的 评论. 这就是你这个问题中提到的错误日志。

你的第二个 拉动请求 在构建日志中,由于以下原因而导致失败

Running "jshint:code" (jshint) task

   src/js/select2/i18n/te.js
     13 |                var message = overChars + ' అక్షరం తొలిగించండి';
                             ^ 'message' is already defined.
     16 |            return message;
                            ^ 'message' used out of scope.
     31 |                var message = 'మీరు ' + args.maximum + ' అంశాల్ని మాత్రమే ఎంచుకోగలరు';
                                                                                              ^ Line is too long.
     33 |                var message = 'మీరు ' + args.maximum + ' అంశాన్ని మాత్రమే ఎంచుకోగలరు';
                                                                                              ^ Line is too long.
     33 |                var message = 'మీరు ' + args.maximum + ' అంశాన్ని మాత్రమే ఎంచుకోగలరు';
                             ^ 'message' is already defined.
     36 |            return message;
                            ^ 'message' used out of scope.

>> 6 errors in 103 files

无论你在哪里看到 'message' is already defined'message' used out of scope的定义不正确,这是因为对""的定义不正确。message 多次使用该变量并在其范围外使用该变量。该错误 Line is too long 是由于特定的行超过了linting配置中设置的每行最大限制。

改变你的 inputTooLong 功能,以

   inputTooLong: function (args) {
        var overChars = args.input.length - args.maximum;
        var message = overChars;

        if (overChars != 1) {
            message += ' అక్షరాలు తొలిగించండి';
        } else {
            message += ' అక్షరం తొలిగించండి';
        }

        return message;
    }

然后换掉你的 maximumSelected 功能,以

   maximumSelected: function (args) {
        var message = 'మీరు ' + args.maximum;

        if (args.maximum != 1) {
            message += ' అంశాల్ని మాత్రమే ఎంచుకోగలరు';
        } else {
            message += ' అంశాన్ని మాత్రమే ఎంచుకోగలరు';
        }

        return message;
    }

你给的缩进也比预期的多。比较文件 en.js 中,并相应地去掉多余的缩进。

注意:我建议你 我建议你 在你的本地机器上运行linting build。 使用命令 grunt compile lint 在他们的GitHub行动中指定的 配置因此,你可以 在推送您的更改之前,了解任何错误。 到 GitHub 仓库。

© www.soinside.com 2019 - 2024. All rights reserved.