diff options
author | 2017-07-16 03:40:07 +0300 | |
---|---|---|
committer | 2017-07-17 15:07:27 +0300 | |
commit | fef044fc57d223d8923db9b68d2c74cbf20e77bf (patch) | |
tree | c3c4d924532fbeec936e183d545cc55bc1cd9fde /juick-www | |
parent | 3c1fb681903cb3ed5c1a02d8ce67ed1b376771ef (diff) |
www: eslint-plugin-only-ascii
force i18n in js
Diffstat (limited to 'juick-www')
-rw-r--r-- | juick-www/.eslintrc | 5 | ||||
-rw-r--r-- | juick-www/package.json | 1 | ||||
-rw-r--r-- | juick-www/src/main/static/scripts.js | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/juick-www/.eslintrc b/juick-www/.eslintrc index 1af934cd..5328a00b 100644 --- a/juick-www/.eslintrc +++ b/juick-www/.eslintrc @@ -19,6 +19,7 @@ // Enable custom plugin known as eslint-plugin-react "plugins": [ // "react" + "only-ascii" ], // http://eslint.org/docs/rules/ "rules": { @@ -52,6 +53,8 @@ "no-cond-assign": "off", "no-sparse-arrays": "off", "no-unused-vars": "off", - "no-useless-escape": "off" + "no-useless-escape": "off", + + "only-ascii/only-ascii": ["warn", { "allowedChars": "✓" }] // "excludePaths": ["i18n.js"] } } diff --git a/juick-www/package.json b/juick-www/package.json index 74e0e253..0a3a6c61 100644 --- a/juick-www/package.json +++ b/juick-www/package.json @@ -18,6 +18,7 @@ "css-loader": "^0.28.4", "eslint": "^4.0.0", "eslint-loader": "^1.8.0", + "eslint-plugin-only-ascii":"^0.0.0", "extract-text-webpack-plugin": "^2.1.2", "file-loader": "^0.11.2", "globby": "^6.1.0", diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index a5da0849..357b1c30 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -32,6 +32,7 @@ if (!('remove' in Element.prototype)) { // Firefox <23 NodeList.prototype.forEach = Array.prototype.forEach; HTMLCollection.prototype.forEach = Array.prototype.forEach; +/* eslint-disable only-ascii/only-ascii */ const translations = { 'en': { 'message.inReplyTo': 'in reply to', @@ -66,6 +67,7 @@ const translations = { 'error.error': 'Ошибка' } }; +/* eslint-enable only-ascii/only-ascii */ function getLang() { return (window.navigator.languages && window.navigator.languages[0]) |