Skip to content

Commit

Permalink
Replace TSLint with ESLint #2041
Browse files Browse the repository at this point in the history
Removed TSLint comments.
  • Loading branch information
edloidas committed Jul 23, 2021
1 parent ec8e67f commit f313b53
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 23 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'tsconfigRootDir': '.',
},
'rules': {
'max-len': ['error', {'code': 140, 'comments': 180}],
'block-spacing': ['error', 'always'],
'space-before-function-paren': ['error', {'anonymous': 'always', 'named': 'never'}],
'space-in-parens': ['error', 'never'],
Expand Down
26 changes: 13 additions & 13 deletions src/main/resources/assets/admin/common/js/NamePrettyfier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class NamePrettyfier {
let defaultDiacriticsRemovalMap = [
{
base: 'A',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F'
},
{base: 'AA', letters: '\uA732'},
Expand All @@ -160,22 +160,22 @@ export class NamePrettyfier {
{base: 'Dz', letters: '\u01F2\u01C5'},
{
base: 'E',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E'
},
{base: 'F', letters: '\u0046\u24BB\uFF26\u1E1E\u0191\uA77B'},
{base: 'G', letters: '\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E'},
{base: 'H', letters: '\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D'},
{
base: 'I',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197'
},
{base: 'J', letters: '\u004A\u24BF\uFF2A\u0134\u0248'},
{base: 'K', letters: '\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2'},
{
base: 'L',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780'
},
{base: 'LJ', letters: '\u01C7'},
Expand All @@ -189,7 +189,7 @@ export class NamePrettyfier {
{base: 'Nj', letters: '\u01CB'},
{
base: 'O',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C'
},
{base: 'OI', letters: '\u01A2'},
Expand All @@ -211,7 +211,7 @@ export class NamePrettyfier {
{base: 'TZ', letters: '\uA728'},
{
base: 'U',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244'
},
{base: 'V', letters: '\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245'},
Expand All @@ -222,7 +222,7 @@ export class NamePrettyfier {
{base: 'Z', letters: '\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762'},
{
base: 'a',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250'
},
{base: 'aa', letters: '\uA733'},
Expand All @@ -237,7 +237,7 @@ export class NamePrettyfier {
{base: 'dz', letters: '\u01F3\u01C6'},
{
base: 'e',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD'
},
{base: 'f', letters: '\u0066\u24D5\uFF46\u1E1F\u0192\uA77C'},
Expand All @@ -246,14 +246,14 @@ export class NamePrettyfier {
{base: 'hv', letters: '\u0195'},
{
base: 'i',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131'
},
{base: 'j', letters: '\u006A\u24D9\uFF4A\u0135\u01F0\u0249'},
{base: 'k', letters: '\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3'},
{
base: 'l',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747'
},
{base: 'lj', letters: '\u01C9'},
Expand All @@ -265,7 +265,7 @@ export class NamePrettyfier {
{base: 'nj', letters: '\u01CC'},
{
base: 'o',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275'
},
{base: 'oi', letters: '\u01A3'},
Expand All @@ -279,7 +279,7 @@ export class NamePrettyfier {
},
{
base: 's',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B'
},
{
Expand All @@ -289,7 +289,7 @@ export class NamePrettyfier {
{base: 'tz', letters: '\uA729'},
{
base: 'u',
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
letters: '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289'
},
{base: 'v', letters: '\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ export class PropertySet

isEmpty(): boolean {
let isEmpty: boolean = true;
// tslint:disable-next-line:forin
for (const name in this.propertyArrayByName) {
if (!isEmpty) {
return isEmpty;
Expand Down Expand Up @@ -575,6 +574,7 @@ export class PropertySet
*/
newSet(): PropertySet {
if (!this.tree) {
// eslint-disable-next-line max-len
throw new Error(
'The PropertySet must be attached to a PropertyTree before this method can be invoked. Use PropertySet constructor with no arguments instead.');
}
Expand All @@ -590,6 +590,7 @@ export class PropertySet
addPropertySet(name: string, value?: PropertySet): PropertySet {
if (!value) {
if (!this.tree) {
// eslint-disable-next-line max-len
throw new Error(
'The PropertySet must be attached to a PropertyTree before this method can be invoked. Use PropertySet constructor with no arguments instead.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/admin/common/js/dom/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Element {

if (this.parentElement && this.el.getHTMLElement().parentElement) {
if (!(this.parentElement.getHTMLElement() === this.el.getHTMLElement().parentElement)) {
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
throw new Error('Illegal state: HTMLElement in parent Element is not the as the HTMLElement parent to this HTMLElement');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class ServerEventsListener {
this.fireEvent(event);
}

// tslint:disable-next-line:no-unused-expression
protected onUnknownServerEvent(_eventJson: EventJson) {
//
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class EmailInput

createInput(): InputEl {
let input = new InputEl(undefined, 'email');
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
input.setPattern('^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$');

input.onFocus((event: FocusEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/admin/common/js/util/DateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class DateTime
2015-02-29T12:05:59+01:00
2015-02-29T12:05:59.001+01:00
*/
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
const regex = /^(\d{2}|\d{4})(?:\-)?([0]{1}\d{1}|[1]{1}[0-2]{1})(?:\-)?([0-2]{1}\d{1}|[3]{1}[0-1]{1})(T)([0-1]{1}\d{1}|[2]{1}[0-3]{1})(?::)?([0-5]{1}\d{1})((:[0-5]{1}\d{1})(\.\d{3})?)?((\+|\-)([0-1]{1}\d{1}|[2]{1}[0-3]{1})(:)([0-5]{1}\d{1})|(z|Z)|$)$/;
return regex.test(s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class LocalDateTime
return false;
}

// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
const regex = /^(\d{2}|([12]\d{3}))(?:\-)?([0]{1}\d{1}|[1]{1}[0-2]{1})(?:\-)?([0-2]{1}\d{1}|[3]{1}[0-1]{1})(T)([0-1]{1}\d{1}|[2]{1}[0-3]{1})(?::)?([0-5]{1}\d{1})(?::)?([0-5]{1}\d{1})?(?:.)?(\d{3})?/;
return regex.test(s);
}
Expand Down Expand Up @@ -125,7 +125,7 @@ export class LocalDateTime
}

timeToString(): string {
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
let fractions = this.fractions ? LocalDateTime.FRACTION_SEPARATOR + this.padNumber(this.fractions, 3) : StringHelper.EMPTY_STRING;

return this.padNumber(this.hours) + LocalDateTime.TIME_SEPARATOR +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ describe('api.data.PropertyPath', () => {

it("doesn't accept null in first constructor argument", () => {
expect(() => {
// tslint:disable-next-line:no-unused-expression
new PropertyPath([null]);
}).toThrow();
});

it("doesn't accept PropertyPathElement's with empty name in first constructor argument", () => {
expect(() => {
// tslint:disable-next-line:no-unused-expression
new PropertyPath([new PropertyPathElement('', 0)]);
}).toThrow();
});
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/assets/spec/common/data/Value.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ describe('api.data.Value', () => {
it('given a letter as value and ValueType is LONG then Error is thrown', () => {

expect(() => {
// tslint:disable-next-line:no-unused-expression
new Value('a', ValueTypes.LONG);

}).toThrow(new Error('Invalid value for type Long: a'));
Expand Down

0 comments on commit f313b53

Please sign in to comment.