From 68719b3b6dbe00297c8c35407981096ebae1b9e4 Mon Sep 17 00:00:00 2001 From: Mingyu Kim Date: Mon, 18 Oct 2021 17:41:40 +0900 Subject: [PATCH] feat: add react, vue, ngx view360 * style: apply eslint * feat: update component version * docs: add contribution guide * feat: add cfc methods * feat: add react-view360 * feat: export spinviewer constants & types for cfc * feat: add react spinviewer * feat: add vue-view360 * feat: add class options to accept external elements * feat: update packages to create own elements * feat: add ngx-view360 * fix: change canvas DOM instance to prevent WebGL error --- .eslintrc.js | 370 + CONTRIBUTING.md | 57 + LICENSE | 2 +- package-lock.json | 22653 +++--- package.json | 12 +- packages/ngx-view360/.gitignore | 46 + packages/ngx-view360/README.md | 120 + packages/ngx-view360/angular.json | 147 + packages/ngx-view360/package-lock.json | 30460 +++++++ packages/ngx-view360/package.json | 39 + .../ngx-view360/projects/demo/browserslist | 11 + .../projects/demo/src/app/app.component.css | 42 + .../projects/demo/src/app/app.component.html | 13 + .../projects/demo/src/app/app.component.ts | 11 + .../projects/demo/src/app/app.module.ts | 35 + .../src/app/rerender/rerender.component.css | 0 .../src/app/rerender/rerender.component.html | 15 + .../src/app/rerender/rerender.component.ts | 30 + .../demo/src/app/spin/spin.component.css | 0 .../demo/src/app/spin/spin.component.html | 12 + .../demo/src/app/spin/spin.component.ts | 30 + .../demo/src/app/video/video.component.css | 0 .../demo/src/app/video/video.component.html | 13 + .../demo/src/app/video/video.component.ts | 30 + .../projects/demo/src/assets/.gitkeep | 0 .../demo/src/environments/environment.prod.ts | 3 + .../demo/src/environments/environment.ts | 16 + .../ngx-view360/projects/demo/src/favicon.ico | Bin 0 -> 5430 bytes .../ngx-view360/projects/demo/src/index.html | 14 + .../ngx-view360/projects/demo/src/main.ts | 12 + .../projects/demo/src/polyfills.ts | 63 + .../ngx-view360/projects/demo/src/styles.css | 1 + .../projects/demo/tsconfig.app.json | 11 + .../projects/ngx-view360/README.md | 120 + .../projects/ngx-view360/karma.conf.js | 32 + .../projects/ngx-view360/ng-package.json | 14 + .../projects/ngx-view360/package.json | 27 + .../src/lib/PanoViewerInterface.ts | 8 + .../src/lib/SpinViewerInterface.ts | 8 + .../src/lib/ngx-pano-viewer.component.ts | 169 + .../src/lib/ngx-pano-viewer.module.ts | 13 + .../src/lib/ngx-spin-viewer.component.ts | 129 + .../src/lib/ngx-spin-viewer.module.ts | 13 + .../projects/ngx-view360/src/public-api.ts | 8 + .../projects/ngx-view360/src/test.ts | 22 + .../projects/ngx-view360/tsconfig.lib.json | 24 + .../ngx-view360/tsconfig.lib.prod.json | 7 + .../projects/ngx-view360/tsconfig.spec.json | 17 + packages/ngx-view360/tsconfig.base.json | 26 + packages/ngx-view360/tsconfig.json | 17 + packages/react-view360/.env | 2 + packages/react-view360/.npmignore | 13 + packages/react-view360/LICENSE | 19 + packages/react-view360/README.md | 94 + packages/react-view360/config-overrides.js | 19 + packages/react-view360/demo/App.css | 42 + packages/react-view360/demo/App.tsx | 30 + packages/react-view360/demo/Header.tsx | 20 + packages/react-view360/demo/index.tsx | 11 + packages/react-view360/demo/pano/Rerender.tsx | 40 + packages/react-view360/demo/pano/Video.tsx | 37 + .../react-view360/demo/react-app-env.d.ts | 1 + packages/react-view360/demo/serviceWorker.ts | 143 + packages/react-view360/demo/spin/Default.tsx | 23 + packages/react-view360/package-lock.json | 67350 ++++++++++++++++ packages/react-view360/package.json | 73 + packages/react-view360/public/favicon.ico | Bin 0 -> 3870 bytes packages/react-view360/public/index.html | 38 + packages/react-view360/public/manifest.json | 15 + packages/react-view360/rollup.config.js | 21 + packages/react-view360/src/PanoViewer.tsx | 124 + packages/react-view360/src/SpinViewer.tsx | 92 + packages/react-view360/src/consts.ts | 21 + packages/react-view360/src/index.ts | 14 + packages/react-view360/src/index.umd.ts | 13 + packages/react-view360/src/react-app-env.d.ts | 1 + packages/react-view360/src/types.ts | 33 + packages/react-view360/tsconfig.build.json | 6 + .../react-view360/tsconfig.declaration.json | 15 + packages/react-view360/tsconfig.json | 31 + packages/react-view360/tsconfig.paths.json | 9 + packages/vue-view360/.npmignore | 31 + packages/vue-view360/LICENSE | 19 + packages/vue-view360/README.md | 119 + packages/vue-view360/demo/Demo.vue | 23 + packages/vue-view360/demo/index.html | 11 + packages/vue-view360/demo/main.ts | 17 + packages/vue-view360/demo/pano/Rerender.vue | 51 + packages/vue-view360/demo/pano/Video.vue | 72 + packages/vue-view360/demo/router.ts | 23 + packages/vue-view360/demo/shims-vue.d.ts | 4 + packages/vue-view360/demo/spin/Spin.vue | 26 + packages/vue-view360/package-lock.json | 31852 ++++++++ packages/vue-view360/package.json | 54 + packages/vue-view360/rollup.config.js | 22 + packages/vue-view360/src/PanoViewer.ts | 113 + packages/vue-view360/src/SpinViewer.ts | 70 + packages/vue-view360/src/index.ts | 28 + packages/vue-view360/src/shims-vue.d.ts | 4 + packages/vue-view360/src/types.ts | 4 + packages/vue-view360/src/utils.ts | 21 + .../vue-view360/tsconfig.declaration.json | 17 + packages/vue-view360/tsconfig.json | 39 + packages/vue-view360/vue.config.js | 8 + rollup.config.js | 2 +- src/PanoImageRenderer/PanoImageRenderer.ts | 105 +- src/PanoImageRenderer/WebGLAnimator.ts | 6 +- src/PanoImageRenderer/WebGLUtils.ts | 17 +- src/PanoImageRenderer/index.ts | 4 +- .../renderer/CubeRenderer.ts | 36 +- .../renderer/CubeStripRenderer.ts | 5 +- .../renderer/CylinderRenderer.ts | 6 +- src/PanoImageRenderer/renderer/Renderer.ts | 42 +- .../renderer/SphereRenderer.ts | 7 +- src/PanoImageRenderer/vr/VRManager.ts | 12 +- src/PanoImageRenderer/vr/XRManager.ts | 12 +- src/PanoViewer/PanoViewer.ts | 342 +- src/PanoViewer/consts.ts | 43 +- src/PanoViewer/index.ts | 10 +- src/PanoViewer/index.umd.ts | 14 +- src/SpinViewer/SpinViewer.ts | 138 +- src/SpinViewer/SpriteImage.ts | 152 +- src/SpinViewer/consts.ts | 28 + src/SpinViewer/index.ts | 14 +- src/SpinViewer/index.umd.ts | 16 +- src/YawPitchControl/DeviceQuaternion.ts | 9 +- src/YawPitchControl/ScreenRotationAngle.ts | 7 +- src/YawPitchControl/YawPitchControl.ts | 185 +- src/YawPitchControl/consts.ts | 84 +- src/YawPitchControl/input/DeviceMotion.ts | 29 +- src/YawPitchControl/input/FusionPoseSensor.ts | 23 +- src/YawPitchControl/input/RotationPanInput.ts | 8 +- src/YawPitchControl/input/TiltMotionInput.ts | 28 +- .../webvr-polyfill/complementary-filter.ts | 25 +- .../input/lib/webvr-polyfill/math-util.ts | 57 +- .../lib/webvr-polyfill/pose-predictor.ts | 7 +- .../input/lib/webvr-polyfill/sensor-sample.ts | 2 +- .../input/lib/webvr-polyfill/util.ts | 32 +- src/YawPitchControl/utils.ts | 27 +- src/cfc/index.ts | 11 + src/cfc/updatePanoViewer.ts | 40 + src/cfc/withMethods.ts | 35 + src/cfc/withPanoViewerMethods.ts | 9 + src/cfc/withSpinViewerMethods.ts | 9 + src/index.ts | 18 +- src/index.umd.ts | 25 +- src/types.ts | 21 - src/types/event.ts | 193 + src/types/internal.ts | 37 + src/utils/browser.ts | 11 +- src/utils/browserFeature.ts | 65 +- src/utils/math-util.ts | 45 +- src/utils/utils.ts | 48 +- src/version.ts | 2 +- tsconfig.eslint.json | 10 + tslint.json | 46 - 156 files changed, 147786 insertions(+), 10273 deletions(-) create mode 100644 .eslintrc.js create mode 100644 CONTRIBUTING.md create mode 100644 packages/ngx-view360/.gitignore create mode 100644 packages/ngx-view360/README.md create mode 100644 packages/ngx-view360/angular.json create mode 100644 packages/ngx-view360/package-lock.json create mode 100644 packages/ngx-view360/package.json create mode 100644 packages/ngx-view360/projects/demo/browserslist create mode 100644 packages/ngx-view360/projects/demo/src/app/app.component.css create mode 100644 packages/ngx-view360/projects/demo/src/app/app.component.html create mode 100644 packages/ngx-view360/projects/demo/src/app/app.component.ts create mode 100644 packages/ngx-view360/projects/demo/src/app/app.module.ts create mode 100644 packages/ngx-view360/projects/demo/src/app/rerender/rerender.component.css create mode 100644 packages/ngx-view360/projects/demo/src/app/rerender/rerender.component.html create mode 100644 packages/ngx-view360/projects/demo/src/app/rerender/rerender.component.ts create mode 100644 packages/ngx-view360/projects/demo/src/app/spin/spin.component.css create mode 100644 packages/ngx-view360/projects/demo/src/app/spin/spin.component.html create mode 100644 packages/ngx-view360/projects/demo/src/app/spin/spin.component.ts create mode 100644 packages/ngx-view360/projects/demo/src/app/video/video.component.css create mode 100644 packages/ngx-view360/projects/demo/src/app/video/video.component.html create mode 100644 packages/ngx-view360/projects/demo/src/app/video/video.component.ts create mode 100644 packages/ngx-view360/projects/demo/src/assets/.gitkeep create mode 100644 packages/ngx-view360/projects/demo/src/environments/environment.prod.ts create mode 100644 packages/ngx-view360/projects/demo/src/environments/environment.ts create mode 100644 packages/ngx-view360/projects/demo/src/favicon.ico create mode 100644 packages/ngx-view360/projects/demo/src/index.html create mode 100644 packages/ngx-view360/projects/demo/src/main.ts create mode 100644 packages/ngx-view360/projects/demo/src/polyfills.ts create mode 100644 packages/ngx-view360/projects/demo/src/styles.css create mode 100644 packages/ngx-view360/projects/demo/tsconfig.app.json create mode 100644 packages/ngx-view360/projects/ngx-view360/README.md create mode 100644 packages/ngx-view360/projects/ngx-view360/karma.conf.js create mode 100644 packages/ngx-view360/projects/ngx-view360/ng-package.json create mode 100644 packages/ngx-view360/projects/ngx-view360/package.json create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/PanoViewerInterface.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/SpinViewerInterface.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/ngx-pano-viewer.component.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/ngx-pano-viewer.module.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/ngx-spin-viewer.component.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/lib/ngx-spin-viewer.module.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/public-api.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/src/test.ts create mode 100644 packages/ngx-view360/projects/ngx-view360/tsconfig.lib.json create mode 100644 packages/ngx-view360/projects/ngx-view360/tsconfig.lib.prod.json create mode 100644 packages/ngx-view360/projects/ngx-view360/tsconfig.spec.json create mode 100644 packages/ngx-view360/tsconfig.base.json create mode 100644 packages/ngx-view360/tsconfig.json create mode 100644 packages/react-view360/.env create mode 100644 packages/react-view360/.npmignore create mode 100644 packages/react-view360/LICENSE create mode 100644 packages/react-view360/README.md create mode 100644 packages/react-view360/config-overrides.js create mode 100644 packages/react-view360/demo/App.css create mode 100644 packages/react-view360/demo/App.tsx create mode 100644 packages/react-view360/demo/Header.tsx create mode 100644 packages/react-view360/demo/index.tsx create mode 100644 packages/react-view360/demo/pano/Rerender.tsx create mode 100644 packages/react-view360/demo/pano/Video.tsx create mode 100644 packages/react-view360/demo/react-app-env.d.ts create mode 100644 packages/react-view360/demo/serviceWorker.ts create mode 100644 packages/react-view360/demo/spin/Default.tsx create mode 100644 packages/react-view360/package-lock.json create mode 100644 packages/react-view360/package.json create mode 100644 packages/react-view360/public/favicon.ico create mode 100644 packages/react-view360/public/index.html create mode 100644 packages/react-view360/public/manifest.json create mode 100644 packages/react-view360/rollup.config.js create mode 100644 packages/react-view360/src/PanoViewer.tsx create mode 100644 packages/react-view360/src/SpinViewer.tsx create mode 100644 packages/react-view360/src/consts.ts create mode 100644 packages/react-view360/src/index.ts create mode 100644 packages/react-view360/src/index.umd.ts create mode 100644 packages/react-view360/src/react-app-env.d.ts create mode 100644 packages/react-view360/src/types.ts create mode 100644 packages/react-view360/tsconfig.build.json create mode 100644 packages/react-view360/tsconfig.declaration.json create mode 100644 packages/react-view360/tsconfig.json create mode 100644 packages/react-view360/tsconfig.paths.json create mode 100644 packages/vue-view360/.npmignore create mode 100644 packages/vue-view360/LICENSE create mode 100644 packages/vue-view360/README.md create mode 100644 packages/vue-view360/demo/Demo.vue create mode 100644 packages/vue-view360/demo/index.html create mode 100644 packages/vue-view360/demo/main.ts create mode 100644 packages/vue-view360/demo/pano/Rerender.vue create mode 100644 packages/vue-view360/demo/pano/Video.vue create mode 100644 packages/vue-view360/demo/router.ts create mode 100644 packages/vue-view360/demo/shims-vue.d.ts create mode 100644 packages/vue-view360/demo/spin/Spin.vue create mode 100644 packages/vue-view360/package-lock.json create mode 100644 packages/vue-view360/package.json create mode 100644 packages/vue-view360/rollup.config.js create mode 100644 packages/vue-view360/src/PanoViewer.ts create mode 100644 packages/vue-view360/src/SpinViewer.ts create mode 100644 packages/vue-view360/src/index.ts create mode 100644 packages/vue-view360/src/shims-vue.d.ts create mode 100644 packages/vue-view360/src/types.ts create mode 100644 packages/vue-view360/src/utils.ts create mode 100644 packages/vue-view360/tsconfig.declaration.json create mode 100644 packages/vue-view360/tsconfig.json create mode 100644 packages/vue-view360/vue.config.js create mode 100644 src/SpinViewer/consts.ts create mode 100644 src/cfc/index.ts create mode 100644 src/cfc/updatePanoViewer.ts create mode 100644 src/cfc/withMethods.ts create mode 100644 src/cfc/withPanoViewerMethods.ts create mode 100644 src/cfc/withSpinViewerMethods.ts delete mode 100644 src/types.ts create mode 100644 src/types/event.ts create mode 100644 src/types/internal.ts create mode 100644 tsconfig.eslint.json delete mode 100644 tslint.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..7ac42fd56 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,370 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +module.exports = { + "env": { + "browser": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.eslint.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-plugin-import", + "eslint-plugin-jsdoc", + "eslint-plugin-prefer-arrow", + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "overrides": [ + { + "files": [ + "./**/*.{ts,tsx}" + ], + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:import/typescript" + ], + "rules": { + "@typescript-eslint/adjacent-overload-signatures": "off", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array-simple" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + "Object": { + "message": "Avoid using the `Object` type. Did you mean `object`?" + }, + "Function": { + "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." + }, + "Boolean": { + "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" + }, + "Number": { + "message": "Avoid using the `Number` type. Did you mean `number`?" + }, + "String": { + "message": "Avoid using the `String` type. Did you mean `string`?" + }, + "Symbol": { + "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" + } + } + } + ], + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/consistent-type-definitions": "error", + "@typescript-eslint/dot-notation": "error", + "@typescript-eslint/explicit-member-accessibility": [ + "error", + { + "accessibility": "explicit" + } + ], + "@typescript-eslint/indent": [ + "error", + 2, + { + "FunctionDeclaration": { + "parameters": "first" + }, + "FunctionExpression": { + "parameters": "first" + }, + "SwitchCase": 1 + } + ], + "@typescript-eslint/member-delimiter-style": [ + "error", + { + "multiline": { + "delimiter": "semi", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } + } + ], + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/member-ordering": ["error", { + "default": [ + // Index signature + "signature", + + // Static + "public-static-method", + "protected-static-method", + "private-static-method", + + "public-static-field", + "protected-static-field", + "private-static-field", + + "public-abstract-field", + "protected-abstract-field", + "private-abstract-field", + + "public-instance-field", + "protected-instance-field", + "private-instance-field", + + "constructor", + + // Methods + "public-abstract-method", + "protected-abstract-method", + "private-abstract-method", + + "public-instance-method", + "protected-instance-method", + "private-instance-method" + ] + }], + "@typescript-eslint/no-empty-function": "error", + "@typescript-eslint/no-empty-interface": "warn", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-misused-new": "off", + "@typescript-eslint/no-misused-promises": "off", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-parameter-properties": "off", + "@typescript-eslint/no-unused-expressions": "error", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/no-inferrable-types": "off", + "@typescript-eslint/prefer-for-of": "error", + "@typescript-eslint/prefer-function-type": "error", + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/restrict-template-expressions": "off", + "@typescript-eslint/unbound-method": "off", + "@typescript-eslint/quotes": [ + "error", + "double" + ], + "@typescript-eslint/semi": [ + "error", + "always" + ], + "@typescript-eslint/triple-slash-reference": [ + "error", + { + "path": "always", + "types": "prefer-import", + "lib": "always" + } + ], + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unified-signatures": "error", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-shadow": ["error"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variableLike", + "format": ["camelCase"], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE"], + "modifiers": ["const"] + }, + { + "selector": "memberLike", + "modifiers": ["public"], + "format": ["camelCase"], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "memberLike", + "modifiers": ["protected"], + "format": ["camelCase"], + "leadingUnderscore": "require", + "trailingUnderscore": "forbid" + }, + { + "selector": "memberLike", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "require", + "trailingUnderscore": "forbid" + }, + { + "selector": "classProperty", + "modifiers": ["static"], + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "classProperty", + "modifiers": ["static", "private"], + "format": ["camelCase", "UPPER_CASE"], + "leadingUnderscore": "require", + "trailingUnderscore": "forbid" + }, + { + "selector": "classMethod", + "modifiers": ["static"], + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "classMethod", + "modifiers": ["static", "private"], + "format": ["camelCase", "UPPER_CASE"], + "leadingUnderscore": "require", + "trailingUnderscore": "forbid" + }, + { + "selector": "property", + "modifiers": ["static"], + "format": ["UPPER_CASE"] + }, + { + "selector": "objectLiteralProperty", + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "objectLiteralMethod", + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "parameter", + "modifiers": ["unused"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + }, + { + "selector": "typeLike", + "format": ["PascalCase", "UPPER_CASE"], + "leadingUnderscore": "allow" + }, + { + "selector": "typeProperty", + "format": ["camelCase", "UPPER_CASE"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "import-spacing": true, + "whitespace": [ + true, + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-branch", + "check-type-operator", + "check-type", + "check-typecast", + "check-preblock" + ] + } + } + ] + } + } + ], + "rules": { + "arrow-body-style": "off", + "arrow-parens": [ + "off", + "always" + ], + "brace-style": [ + "error", + "1tbs", + { "allowSingleLine": true } + ], + "comma-dangle": [ + "error", + "never" + ], + "complexity": "off", + "constructor-super": "error", + "curly": "off", + "eol-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "guard-for-in": "off", + "id-blacklist": "off", + "id-match": "off", + "import/order": ["error", {"newlines-between": "always"}], + "jsdoc/check-alignment": "error", + "jsdoc/check-indentation": "off", + "jsdoc/newline-after-description": ["error", "never"], + "max-classes-per-file": [ + "error", + 1 + ], + "max-len": "off", + "new-parens": "error", + "no-bitwise": "off", + "no-caller": "error", + "no-cond-assign": "error", + "no-console": "warn", + "no-debugger": "error", + "no-empty": "error", + "no-eval": "error", + "no-fallthrough": "off", + "no-invalid-this": "off", + "no-multiple-empty-lines": "error", + "no-new-wrappers": "error", + "no-shadow": "off", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef-init": "error", + "no-underscore-dangle": "off", + "no-unsafe-finally": "error", + "no-unsafe-member-access": "off", + "no-unused-labels": "error", + "no-var": "error", + "object-shorthand": "off", + "one-var": [ + "error", + "never" + ], + "prefer-arrow/prefer-arrow-functions": "error", + "prefer-const": "error", + "quote-props": "off", + "radix": "error", + "space-before-function-paren": [ + "error", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "spaced-comment": [ + "error", + "always", + { + "markers": [ + "/" + ] + } + ], + "use-isnan": "error", + "valid-typeof": "off", + "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }] + } +}; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..1ae0ddaaa --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# How to contribute to egjs-view360 +egjs-view360 is opened to everyone and we're welcoming for any kind of contribution. +We believe that our project can grow with your interests helping others' necessities. + +## Style Guide + +egjs-view360 has several style guidelines to follow. +Before your start, please read attentively below instructions. + +### Linting and Code Conventions +We adopted [ESLint](http://eslint.org/) to maintain our code quality. The [rules](https://github.com/naver/eslint-config-naver/tree/master/rules) are modified version based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript). +All rules are described at [.eslintrc](.eslintrc) file. + +### Commit Log Guidelines +egjs-view360 use commit logs in many different purposes (like creating CHANGELOG, ease history searching, etc.). +To not break, you'll be forced to follow our commit log guidelines. +Before your commit/push, make sure following our commit log guidelines. + +The outline is as below: +``` +(): + + + +