fix(schematics): adjust tslint config to work well with clang-formatter
This commit is contained in:
parent
8c5564b235
commit
83bcce183d
@ -67,24 +67,12 @@
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unnecessary-initializer": true,
|
||||
"no-unused-expression": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"prefer-const": true,
|
||||
"quotemark": [
|
||||
true,
|
||||
"single"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": [
|
||||
true,
|
||||
@ -94,27 +82,9 @@
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"variable-name": false,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
|
||||
@ -79,7 +79,6 @@ function updateAngularCLIJson(options: Schema) {
|
||||
|
||||
function updateTsConfigsJson(options: Schema) {
|
||||
return (host: Tree) => {
|
||||
const angularCliJson = JSON.parse(host.read('.angular-cli.json')!.toString('utf-8'));
|
||||
const npmScope = options && options.npmScope ? options.npmScope : options.name;
|
||||
|
||||
updateJsonFile('tsconfig.json', (json) => setUpCompilerOptions(json, npmScope));
|
||||
@ -110,6 +109,20 @@ function updateTsConfigsJson(options: Schema) {
|
||||
};
|
||||
}
|
||||
|
||||
function updateTsLintJson(options: Schema) {
|
||||
return (host: Tree) => {
|
||||
const npmScope = options && options.npmScope ? options.npmScope : options.name;
|
||||
|
||||
updateJsonFile('tslint.json', (json) => {
|
||||
['no-trailing-whitespace', 'one-line', 'quotemark', 'typedef-whitespace', 'whitespace'].forEach(key => {
|
||||
json[key] = undefined;
|
||||
});
|
||||
json['nx-enforce-module-boundaries'] = [true, {'npmScope': npmScope, 'lazyLoad': []}];
|
||||
});
|
||||
return host;
|
||||
};
|
||||
}
|
||||
|
||||
function updateProtractorConf() {
|
||||
return (host: Tree) => {
|
||||
if (!host.exists('protractor.conf.js')) {
|
||||
@ -168,6 +181,7 @@ export default function(options: Schema): Rule {
|
||||
moveFiles(options), branchAndMerge(chain([
|
||||
mergeWith(apply(url('./files'), [])),
|
||||
])),
|
||||
updatePackageJson(), updateAngularCLIJson(options), updateTsConfigsJson(options), updateProtractorConf()
|
||||
updatePackageJson(), updateAngularCLIJson(options), updateTsConfigsJson(options), updateProtractorConf(),
|
||||
updateTsLintJson(options)
|
||||
]);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user