Add prettier.

This commit is contained in:
Roger Far 2022-10-18 10:55:37 -06:00
parent dc5dcbb2d2
commit a775364bfb
12 changed files with 47 additions and 53 deletions

View file

@ -1,23 +1,14 @@
{ {
"root": true, "root": true,
"ignorePatterns": [ "ignorePatterns": ["projects/**/*"],
"projects/**/*"
],
"overrides": [ "overrides": [
{ {
"files": [ "files": ["*.ts"],
"*.ts"
],
"parserOptions": { "parserOptions": {
"project": [ "project": ["tsconfig.json"],
"tsconfig.json"
],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"extends": [ "extends": ["plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates"],
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": { "rules": {
"@angular-eslint/directive-selector": [ "@angular-eslint/directive-selector": [
"error", "error",
@ -38,12 +29,8 @@
} }
}, },
{ {
"files": [ "files": ["*.html"],
"*.html" "extends": ["plugin:@angular-eslint/template/recommended"],
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {} "rules": {}
} }
] ]

2
client/.prettierignore Normal file
View file

@ -0,0 +1,2 @@
.angular
.vscode

View file

@ -45,13 +45,8 @@
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json", "tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss", "inlineStyleLanguage": "scss",
"assets": [ "assets": ["src/favicon.ico", "src/assets"],
"src/favicon.ico", "styles": ["src/styles.scss"],
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [] "scripts": []
}, },
"configurations": { "configurations": {
@ -111,10 +106,7 @@
"lint": { "lint": {
"builder": "@angular-eslint/builder:lint", "builder": "@angular-eslint/builder:lint",
"options": { "options": {
"lintFilePatterns": [ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
"src/**/*.ts",
"src/**/*.html"
]
} }
} }
} }
@ -122,8 +114,6 @@
}, },
"cli": { "cli": {
"analytics": false, "analytics": false,
"schematicCollections": [ "schematicCollections": ["@angular-eslint/schematics"]
"@angular-eslint/schematics"
]
} }
} }

View file

@ -43,6 +43,7 @@
"@typescript-eslint/eslint-plugin": "5.37.0", "@typescript-eslint/eslint-plugin": "5.37.0",
"@typescript-eslint/parser": "5.37.0", "@typescript-eslint/parser": "5.37.0",
"eslint": "^8.23.1", "eslint": "^8.23.1",
"prettier": "^2.7.1",
"typescript": "~4.8.4" "typescript": "~4.8.4"
} }
}, },
@ -10305,6 +10306,21 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-bytes": { "node_modules/pretty-bytes": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
@ -19872,6 +19888,12 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"dev": true "dev": true
}, },
"prettier": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
"dev": true
},
"pretty-bytes": { "pretty-bytes": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",

View file

@ -7,7 +7,8 @@
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"update": "ng update --force --allow-dirty @angular/cli @angular/core @angular/cdk @angular/flex-layout", "update": "ng update --force --allow-dirty @angular/cli @angular/core @angular/cdk @angular/flex-layout",
"lint": "ng lint" "lint": "ng lint",
"prettier": "prettier --write \"./**/*.{ts,html,json}\""
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@ -46,6 +47,7 @@
"@typescript-eslint/eslint-plugin": "5.37.0", "@typescript-eslint/eslint-plugin": "5.37.0",
"@typescript-eslint/parser": "5.37.0", "@typescript-eslint/parser": "5.37.0",
"eslint": "^8.23.1", "eslint": "^8.23.1",
"prettier": "^2.7.1",
"typescript": "~4.8.4" "typescript": "~4.8.4"
} }
} }

View file

@ -9,7 +9,6 @@ export class TorrentStatusPipe implements PipeTransform {
constructor(private pipe: FileSizePipe) {} constructor(private pipe: FileSizePipe) {}
transform(torrent: Torrent): string { transform(torrent: Torrent): string {
if (torrent.error) { if (torrent.error) {
return torrent.error; return torrent.error;
} }

View file

@ -1,3 +1,3 @@
export const environment = { export const environment = {
production: true production: true,
}; };

View file

@ -3,7 +3,7 @@
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
export const environment = { export const environment = {
production: false production: false,
}; };
/* /*

View file

@ -8,5 +8,6 @@ if (environment.production) {
enableProdMode(); enableProdMode();
} }
platformBrowserDynamic().bootstrapModule(AppModule) platformBrowserDynamic()
.catch(err => console.error(err)); .bootstrapModule(AppModule)
.catch((err) => console.error(err));

View file

@ -45,8 +45,7 @@
/*************************************************************************************************** /***************************************************************************************************
* Zone JS is required by default for Angular itself. * Zone JS is required by default for Angular itself.
*/ */
import 'zone.js'; // Included with Angular CLI. import 'zone.js'; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************
* APPLICATION IMPORTS * APPLICATION IMPORTS

View file

@ -5,11 +5,6 @@
"outDir": "./out-tsc/app", "outDir": "./out-tsc/app",
"types": [] "types": []
}, },
"files": [ "files": ["src/main.ts", "src/polyfills.ts"],
"src/main.ts", "include": ["src/**/*.d.ts"]
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
} }

View file

@ -19,10 +19,7 @@
"strictNullChecks": false, "strictNullChecks": false,
"target": "es2020", "target": "es2020",
"module": "es2020", "module": "es2020",
"lib": [ "lib": ["es2020", "dom"]
"es2020",
"dom"
]
}, },
"angularCompilerOptions": { "angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false, "enableI18nLegacyMessageIdFormat": false,