Update usercss-meta (#540)

* Update usercss-meta

* Add: translation for new errors

* Fix: define `anno.rule` in meta linter

* Fix: typo

* Fix: don't display rule id if undefined

* fixup! Fix: don't display rule id if undefined
This commit is contained in:
eight 2018-11-07 23:33:56 +08:00 committed by GitHub
parent 4db8a9ea9a
commit a1a85efc75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 6 deletions

View File

@ -774,14 +774,42 @@
} }
} }
}, },
"meta_invalidRangeUnits": {
"message": "Invalid @var $type$: '$units$' is not a valid unit",
"description": "Error displayed when the value of @var range or @var number is invalid",
"placeholders": {
"type": {
"content": "$1"
},
"units": {
"content": "$2"
}
}
},
"meta_invalidSelect": {
"message": "Invalid @var select: the default value must be an array or an object",
"description": "Error displayed when the value of @var select is invalid"
},
"meta_invalidSelectValue": {
"message": "Invalid @var select: values inside the array/object must be a string",
"description": "Error displayed when the value of @var select is invalid"
},
"meta_invalidSelectEmptyOptions": { "meta_invalidSelectEmptyOptions": {
"message": "Invalid @var select: options list is empty", "message": "Invalid @var select: options list is empty",
"description": "Error displayed when the value of @var select is invalid" "description": "Error displayed when the value of @var select is invalid"
}, },
"meta_invalidSelectLabel": {
"message": "Invalid @var select: option label is empty",
"description": "Error displayed when the value of @var select is invalid"
},
"meta_invalidSelectMultipleDefaults": { "meta_invalidSelectMultipleDefaults": {
"message": "Invalid @var select: multiple default options are defined", "message": "Invalid @var select: multiple default options are defined",
"description": "Error displayed when the value of @var select is invalid" "description": "Error displayed when the value of @var select is invalid"
}, },
"meta_invalidSelectNameDuplicated": {
"message": "Invalid @var select: option name is duplicated",
"description": "Error displayed when the value of @var select is invalid"
},
"meta_invalidSelectValueMismatch": { "meta_invalidSelectValueMismatch": {
"message": "Invalid @var select: value doesn't exist in the option list", "message": "Invalid @var select: value doesn't exist in the option list",
"description": "Error displayed when the value of @var select is invalid" "description": "Error displayed when the value of @var select is invalid"

View File

@ -31,7 +31,8 @@ function createMetaCompiler(cm) {
from: cm.posFromIndex((err.index || 0) + match.index), from: cm.posFromIndex((err.index || 0) + match.index),
to: cm.posFromIndex((err.index || 0) + match.index), to: cm.posFromIndex((err.index || 0) + match.index),
message: err.code && chrome.i18n.getMessage(`meta_${err.code}`, err.args) || err.message, message: err.code && chrome.i18n.getMessage(`meta_${err.code}`, err.args) || err.message,
severity: err.code === 'unknownMeta' ? 'warning' : 'error' severity: err.code === 'unknownMeta' ? 'warning' : 'error',
rule: err.code
}) })
); );
meta = match[0]; meta = match[0];

View File

@ -146,7 +146,8 @@ Object.assign(linter, (() => {
severityIcon.textContent = anno.severity; severityIcon.textContent = anno.severity;
line.textContent = anno.from.line + 1; line.textContent = anno.from.line + 1;
col.textContent = anno.from.ch + 1; col.textContent = anno.from.ch + 1;
message.title = clipString(anno.message, 1000) + `\n(${anno.rule})`; message.title = clipString(anno.message, 1000) +
(anno.rule ? `\n(${anno.rule})` : '');
message.textContent = clipString(anno.message, 100); message.textContent = clipString(anno.message, 100);
} }
} }

View File

@ -19,7 +19,7 @@
"stylelint-bundle": "^8.0.0", "stylelint-bundle": "^8.0.0",
"stylus-lang-bundle": "^0.54.5", "stylus-lang-bundle": "^0.54.5",
"updates": "^5.1.2", "updates": "^5.1.2",
"usercss-meta": "^0.8.1", "usercss-meta": "^0.8.3",
"web-ext": "^2.9.1", "web-ext": "^2.9.1",
"webext-tx-fix": "^0.3.1" "webext-tx-fix": "^0.3.1"
}, },

View File

@ -1,5 +1,5 @@
## usercss-meta v0.8.1 ## usercss-meta v0.8.3
usercss-meta installed via npm - source repo: usercss-meta installed via npm - source repo:
https://unpkg.com/usercss-meta@0.8.1/dist/usercss-meta.min.js https://unpkg.com/usercss-meta@0.8.3/dist/usercss-meta.min.js

File diff suppressed because one or more lines are too long