Browse Source

Merge pull request #6593 from abpframework/build/tslint-variable-name-and-member-ordering

Modified variable-name rule and removed member-ordering rule
pull/6601/head
Bunyamin Coskuner 6 years ago
committed by GitHub
parent
commit
62466fad03
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      npm/ng-packs/packages/core/src/lib/utils/string-utils.ts
  2. 34
      npm/ng-packs/tslint.json

4
npm/ng-packs/packages/core/src/lib/utils/string-utils.ts

@ -1,12 +1,12 @@
export function createTokenParser(format: string) { export function createTokenParser(format: string) {
return (string: string) => { return (str: string) => {
const tokens: string[] = []; const tokens: string[] = [];
const regex = format.replace(/\./g, '\\.').replace(/\{\s?([0-9a-zA-Z]+)\s?\}/g, (_, token) => { const regex = format.replace(/\./g, '\\.').replace(/\{\s?([0-9a-zA-Z]+)\s?\}/g, (_, token) => {
tokens.push(token); tokens.push(token);
return '(.+)'; return '(.+)';
}); });
const matches = (string.match(regex) || []).slice(1); const matches = (str.match(regex) || []).slice(1);
return matches.reduce((acc, v, i) => { return matches.reduce((acc, v, i) => {
const key = tokens[i]; const key = tokens[i];

34
npm/ng-packs/tslint.json

@ -3,10 +3,7 @@
"rulesDirectory": ["node_modules/codelyzer"], "rulesDirectory": ["node_modules/codelyzer"],
"rules": { "rules": {
"align": { "align": {
"options": [ "options": ["parameters", "statements"]
"parameters",
"statements"
]
}, },
"array-type": false, "array-type": false,
"contextual-lifecycle": true, "contextual-lifecycle": true,
@ -15,9 +12,7 @@
"eofline": true, "eofline": true,
"import-spacing": true, "import-spacing": true,
"indent": { "indent": {
"options": [ "options": ["spaces"]
"spaces"
]
}, },
"max-line-length": [true, 140], "max-line-length": [true, 140],
"no-consecutive-blank-lines": false, "no-consecutive-blank-lines": false,
@ -77,13 +72,8 @@
"import-blacklist": [true, "rxjs/Rx"], "import-blacklist": [true, "rxjs/Rx"],
"interface-over-type-literal": true, "interface-over-type-literal": true,
"interface-name": [true, "never-prefix"], "interface-name": [true, "never-prefix"],
"member-access": [false], "member-access": false,
"member-ordering": [ "member-ordering": false,
true,
{
"order": ["static-field", "instance-field", "static-method", "instance-method"]
}
],
"no-arg": true, "no-arg": true,
"no-bitwise": true, "no-bitwise": true,
"no-conflicting-lifecycle": true, "no-conflicting-lifecycle": true,
@ -134,9 +124,17 @@
"unified-signatures": true, "unified-signatures": true,
"use-lifecycle-interface": true, "use-lifecycle-interface": true,
"use-pipe-transform-interface": true, "use-pipe-transform-interface": true,
"variable-name": false, "variable-name": {
"prefer-for-of": false "options": [
, "whitespace": { "ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case",
"allow-snake-case"
]
},
"prefer-for-of": true,
"whitespace": {
"options": [ "options": [
"check-branch", "check-branch",
"check-decl", "check-decl",
@ -146,5 +144,5 @@
"check-typecast" "check-typecast"
] ]
} }
} }
} }

Loading…
Cancel
Save