ci: Ensure that eslint runs on all frontend code (no-changelog) (#4602)

* ensure that eslint runs on all frontend code

* remove tslint from `design-system`

* enable prettier and eslint-prettier for `design-system`

* Delete tslint.json

* use a single editorconfig for the repo

* enable prettier for all code in `design-system`

* more linting fixes on design-system

* ignore coverage for git and prettier

* lintfix on editor-ui
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-15 18:20:54 +01:00
committed by GitHub
parent d96d6f11db
commit 13659d036f
227 changed files with 2222 additions and 2566 deletions

View File

@@ -2,8 +2,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty;
export function hasOwn(obj, key) {
return hasOwnProperty.call(obj, key);
};
}
const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
/**
@@ -12,15 +11,14 @@ const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
* https://github.com/ElemeFE/element/blob/dev/src/locale/format.js
* https://github.com/Matt-Esch/string-template/index.js
*/
export default function(Vue) {
export default function (Vue) {
/**
* template
*
* @param {String | Function} string
* @param {Array} ...args
* @return {String}
*/
* template
*
* @param {String | Function} string
* @param {Array} ...args
* @return {String}
*/
function template(value, ...args) {
if (typeof value === 'function') {
@@ -38,8 +36,7 @@ export default function(Vue) {
return string.replace(RE_NARGS, (match, prefix, i, index) => {
let result;
if (string[index - 1] === '{' &&
string[index + match.length] === '}') {
if (string[index - 1] === '{' && string[index + match.length] === '}') {
return i;
} else {
result = hasOwn(args, i) ? args[i] : null;

View File

@@ -11,10 +11,10 @@ let lang = defaultLang;
let i18nHandler;
export const t = function(path, options) {
export const t = function (path, options) {
if (typeof i18nHandler === 'function') {
const value = i18nHandler.apply(this, arguments);
if (value !== null && value !== undefined && value !== path) return value;
if (value !== null && value !== undefined && value !== path) return String(value);
}
// only support flat keys
@@ -25,8 +25,7 @@ export const t = function(path, options) {
return '';
};
export const use = function(l) {
export const use = function (l) {
try {
const ndsLang = require(`./lang/${l}`);
lang = ndsLang.default;
@@ -34,11 +33,10 @@ export const use = function(l) {
// todo breaks select empty data
// const elLang = require(`element-ui/lib/locale/lang/${l}`);;
// ElementLocale.use(elLang);
} catch (e) {
}
} catch (e) {}
};
export const i18n = function(fn) {
export const i18n = function (fn) {
i18nHandler = fn || i18nHandler;
};

View File

@@ -14,10 +14,10 @@ export default {
return `Must have at least ${config.minimum} number${config.minimum > 1 ? 's' : ''}`;
},
'formInput.validator.validEmailRequired': 'Must be a valid email',
'formInput.validator.uppercaseCharsRequired': (config) => (`Must have at least ${config.minimum} uppercase character${
config.minimum > 1 ? 's' : ''
}`),
"formInput.validator.defaultPasswordRequirements": "8+ characters, at least 1 number and 1 capital letter",
"sticky.markdownHint": `You can style with <a href="https://docs.n8n.io/workflows/sticky-notes/" target="_blank">Markdown</a>`,
'formInput.validator.uppercaseCharsRequired': (config) =>
`Must have at least ${config.minimum} uppercase character${config.minimum > 1 ? 's' : ''}`,
'formInput.validator.defaultPasswordRequirements':
'8+ characters, at least 1 number and 1 capital letter',
'sticky.markdownHint': `You can style with <a href="https://docs.n8n.io/workflows/sticky-notes/" target="_blank">Markdown</a>`,
'tags.showMore': (count) => `+${count} more`,
};