From fef044fc57d223d8923db9b68d2c74cbf20e77bf Mon Sep 17 00:00:00 2001 From: KillyMXI Date: Sun, 16 Jul 2017 03:40:07 +0300 Subject: www: eslint-plugin-only-ascii force i18n in js --- juick-www/.eslintrc | 5 ++++- juick-www/package.json | 1 + juick-www/src/main/static/scripts.js | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) 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]) -- cgit v1.2.3