diff --git a/.editorconfig b/.editorconfig index e89330a61..6e87a003d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# Editor configuration, see https://editorconfig.org +# Editor configuration, see http://editorconfig.org root = true [*] diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..e461be3f2 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,15 @@ +# Valid +/**/*.spec.ts +/**/*.stories.ts +/**/*.json +/**/*.po.ts + +# GQL auto generated files +/**/*types.ts + +# Config file in JS +/**/*index.js +/**/*index.ts +wallaby.js +decorate-angular-cli.js + diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..f00cd6c95 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "parser": "@typescript-eslint/parser", + "extends": [ + "@wemaintain/eslint-config", + "eslint:recommended", + "plugin:@angular-eslint/recommended", + "plugin:prettier/recommended", + "prettier/@typescript-eslint", + "prettier" + ], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "project": "./tsconfig.base.json" + }, + "rules": { + "max-len": ["off"] + }, + "overrides": [ + { + "files": ["**/*.ts", "**/*.spec.ts"], + "plugins": ["@angular-eslint/template"], + "rules": { + "@typescript-eslint/no-explicit-any": ["off"] + } + } + ] +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..1f0d12187 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,14 @@ +# Artifacts +coverage +dist +build + +# GQL auto generated files +/**/*types.ts + +# Config file in JS +/**/*index.js +/**/*index.ts +wallaby.js +decorate-angular-cli.js + diff --git a/.prettierrc b/.prettierrc index 544138be4..f8dec5b18 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,5 @@ { + "tabWidth": 2, + "semi": false, "singleQuote": true } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..7804e2602 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "nrwl.angular-console", + "angular.ng-template", + "ms-vscode.vscode-typescript-tslint-plugin", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..fa52a7397 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:4200", + "webRoot": "${workspaceFolder}", + "runtimeExecutable": "/usr/bin/google-chrome-stable" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..546876fe9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,27 @@ +{ + "editor.tabSize": 2, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } + }, + "[html]": { + "editor.defaultFormatter": "vscode.html-language-features" + }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } +} diff --git a/angular.json b/angular.json index 066bf98f6..5d96786b4 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "ng2-pdf-viewer": { + "pdf-viewer": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -23,13 +23,8 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], "scripts": [] }, "configurations": { @@ -66,18 +61,18 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "ng2-pdf-viewer:build" + "browserTarget": "pdf-viewer:build" }, "configurations": { "production": { - "browserTarget": "ng2-pdf-viewer:build:production" + "browserTarget": "pdf-viewer:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "ng2-pdf-viewer:build" + "browserTarget": "pdf-viewer:build" } }, "test": { @@ -87,13 +82,8 @@ "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], "scripts": [] } }, @@ -105,28 +95,26 @@ "tsconfig.spec.json", "e2e/tsconfig.json" ], - "exclude": [ - "**/node_modules/**" - ] + "exclude": ["**/node_modules/**"] } }, "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "ng2-pdf-viewer:serve" + "devServerTarget": "pdf-viewer:serve" }, "configurations": { "production": { - "devServerTarget": "ng2-pdf-viewer:serve:production" + "devServerTarget": "pdf-viewer:serve:production" } } } } } }, - "defaultProject": "ng2-pdf-viewer", + "defaultProject": "pdf-viewer", "cli": { "analytics": false } -} \ No newline at end of file +} diff --git a/docs/404.html b/docs/404.html index ffbe2b2f0..e4998770d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,10 +6,10 @@ -