| 
									
										
										
										
											2023-04-09 23:08:24 +02:00
										 |  |  | module.exports = { | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |     env: { | 
					
						
							|  |  |  |         browser: true, | 
					
						
							|  |  |  |         commonjs: true, | 
					
						
							|  |  |  |         es2021: true, | 
					
						
							|  |  |  |         node: true, | 
					
						
							| 
									
										
										
										
											2023-04-09 23:08:24 +02:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |     plugins: ['prettier'], | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     extends: ['eslint:recommended', 'airbnb-base', 'plugin:jsonc/recommended-with-jsonc', 'prettier'], | 
					
						
							|  |  |  |     overrides: [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             files: ['*.json', '*.json5', '*.jsonc'], | 
					
						
							|  |  |  |             parser: 'jsonc-eslint-parser', | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             files: ['package.json'], | 
					
						
							|  |  |  |             parser: 'jsonc-eslint-parser', | 
					
						
							|  |  |  |             rules: { | 
					
						
							|  |  |  |                 'jsonc/sort-keys': [ | 
					
						
							| 
									
										
										
										
											2023-04-11 00:37:38 +08:00
										 |  |  |                     // here is rule  (to be deleted)
 | 
					
						
							|  |  |  |                     'off', | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |                     { | 
					
						
							|  |  |  |                         pathPattern: '^$', | 
					
						
							|  |  |  |                         order: [ | 
					
						
							|  |  |  |                             'name', | 
					
						
							|  |  |  |                             'version', | 
					
						
							|  |  |  |                             'private', | 
					
						
							|  |  |  |                             'packageManager', | 
					
						
							|  |  |  |                             'description', | 
					
						
							|  |  |  |                             'type', | 
					
						
							|  |  |  |                             'keywords', | 
					
						
							|  |  |  |                             'homepage', | 
					
						
							|  |  |  |                             'bugs', | 
					
						
							|  |  |  |                             'license', | 
					
						
							|  |  |  |                             'author', | 
					
						
							|  |  |  |                             'contributors', | 
					
						
							|  |  |  |                             'funding', | 
					
						
							|  |  |  |                             'files', | 
					
						
							|  |  |  |                             'main', | 
					
						
							|  |  |  |                             'module', | 
					
						
							|  |  |  |                             'exports', | 
					
						
							|  |  |  |                             'unpkg', | 
					
						
							|  |  |  |                             'jsdelivr', | 
					
						
							|  |  |  |                             'browser', | 
					
						
							|  |  |  |                             'bin', | 
					
						
							|  |  |  |                             'man', | 
					
						
							|  |  |  |                             'directories', | 
					
						
							|  |  |  |                             'repository', | 
					
						
							|  |  |  |                             'publishConfig', | 
					
						
							|  |  |  |                             'scripts', | 
					
						
							|  |  |  |                             'peerDependencies', | 
					
						
							|  |  |  |                             'peerDependenciesMeta', | 
					
						
							|  |  |  |                             'optionalDependencies', | 
					
						
							|  |  |  |                             'dependencies', | 
					
						
							|  |  |  |                             'devDependencies', | 
					
						
							|  |  |  |                             'engines', | 
					
						
							|  |  |  |                             'config', | 
					
						
							|  |  |  |                             'overrides', | 
					
						
							|  |  |  |                             'pnpm', | 
					
						
							|  |  |  |                             'husky', | 
					
						
							|  |  |  |                             'lint-staged', | 
					
						
							|  |  |  |                             'eslintConfig', | 
					
						
							|  |  |  |                         ], | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     { | 
					
						
							|  |  |  |                         pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$', | 
					
						
							|  |  |  |                         order: { type: 'asc' }, | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                 ], | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2023-04-09 23:08:24 +02:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |     globals: { | 
					
						
							|  |  |  |         $: true, | 
					
						
							|  |  |  |         jQuery: true, | 
					
						
							|  |  |  |         glob: true, | 
					
						
							|  |  |  |         log: true, | 
					
						
							|  |  |  |         EditorWatchdog: true, | 
					
						
							|  |  |  |         baseApiUrl: true, | 
					
						
							|  |  |  |         // \src\share\canvas_share.js
 | 
					
						
							|  |  |  |         React: true, | 
					
						
							|  |  |  |         appState: true, | 
					
						
							|  |  |  |         ExcalidrawLib: true, | 
					
						
							|  |  |  |         elements: true, | 
					
						
							|  |  |  |         files: true, | 
					
						
							|  |  |  |         ReactDOM: true, | 
					
						
							|  |  |  |         // src\public\app\widgets\type_widgets\relation_map.js
 | 
					
						
							|  |  |  |         jsPlumb: true, | 
					
						
							|  |  |  |         panzoom: true, | 
					
						
							|  |  |  |         logError: true, | 
					
						
							|  |  |  |         // src\public\app\widgets\type_widgets\image.js
 | 
					
						
							|  |  |  |         WZoom: true, | 
					
						
							|  |  |  |         // \src\public\app\widgets\type_widgets\read_only_text.js
 | 
					
						
							|  |  |  |         renderMathInElement: true, | 
					
						
							|  |  |  |         // \src\public\app\widgets\type_widgets\editable_text.js
 | 
					
						
							|  |  |  |         BalloonEditor: true, | 
					
						
							|  |  |  |         CKEditorInspector: true, | 
					
						
							|  |  |  |         // \src\public\app\widgets\type_widgets\editable_code.js
 | 
					
						
							|  |  |  |         CodeMirror: true, | 
					
						
							|  |  |  |         // \src\public\app\services\resizer.js
 | 
					
						
							|  |  |  |         Split: true, | 
					
						
							|  |  |  |         // \src\public\app\services\note_content_renderer.js
 | 
					
						
							|  |  |  |         mermaid: true, | 
					
						
							|  |  |  |         // src\public\app\services\frontend_script_api.js
 | 
					
						
							|  |  |  |         dayjs: true, | 
					
						
							|  |  |  |         // \src\public\app\widgets\dialogs\markdown_import.js
 | 
					
						
							|  |  |  |         commonmark: true, | 
					
						
							|  |  |  |         // \src\public\app\widgets\note_map.js
 | 
					
						
							|  |  |  |         ForceGraph: true, | 
					
						
							|  |  |  |         // \src\public\app\setup.js
 | 
					
						
							|  |  |  |         ko: true, | 
					
						
							|  |  |  |         syncInProgress: true, | 
					
						
							|  |  |  |         // src\public\app\services\utils.js
 | 
					
						
							|  |  |  |         logInfo: true, | 
					
						
							|  |  |  |         __non_webpack_require__: true, | 
					
						
							|  |  |  |         //
 | 
					
						
							| 
									
										
										
										
											2023-04-09 23:08:24 +02:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |     parserOptions: { | 
					
						
							|  |  |  |         ecmaVersion: 'latest', | 
					
						
							|  |  |  |         sourceType: 'module', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     rules: { | 
					
						
							|  |  |  |         // hi adam, those rules are //temporary off, you can turn them on one by one to check if we really need it. (to be deleted)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // eslint:recommended
 | 
					
						
							|  |  |  |         'no-unused-vars': 'off', | 
					
						
							|  |  |  |         'linebreak-style': 'off', | 
					
						
							|  |  |  |         'no-useless-escape': 'off', | 
					
						
							|  |  |  |         'no-empty': 'off', | 
					
						
							|  |  |  |         'no-constant-condition': 'off', | 
					
						
							|  |  |  |         'getter-return': 'off', | 
					
						
							|  |  |  |         'no-cond-assign': 'off', | 
					
						
							|  |  |  |         'no-async-promise-executor': 'off', | 
					
						
							|  |  |  |         'no-extra-semi': 'off', | 
					
						
							|  |  |  |         'no-inner-declarations': 'off', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // prettier
 | 
					
						
							| 
									
										
										
										
											2023-04-11 00:37:38 +08:00
										 |  |  |         // all about formating, it might take a while to excute it. you can change the config in .prettierrc.js (to be deleted)
 | 
					
						
							|  |  |  |         'prettier/prettier': ['off', { endOfLine: 'auto' }], | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // airbnb-base
 | 
					
						
							|  |  |  |         'no-console': 'off', | 
					
						
							|  |  |  |         'no-plusplus': 'off', | 
					
						
							|  |  |  |         'no-param-reassign': 'off', | 
					
						
							|  |  |  |         'global-require': 'off', | 
					
						
							|  |  |  |         'no-use-before-define': 'off', | 
					
						
							|  |  |  |         'no-await-in-loop': 'off', | 
					
						
							|  |  |  |         radix: 'off', | 
					
						
							|  |  |  |         'import/order': 'off', | 
					
						
							|  |  |  |         'import/no-extraneous-dependencies': 'off', | 
					
						
							|  |  |  |         'prefer-destructuring': 'off', | 
					
						
							|  |  |  |         'no-shadow': 'off', | 
					
						
							|  |  |  |         'no-new': 'off', | 
					
						
							|  |  |  |         'no-restricted-syntax': 'off', | 
					
						
							|  |  |  |         strict: 'off', | 
					
						
							|  |  |  |         'class-methods-use-this': 'off', | 
					
						
							|  |  |  |         'no-else-return': 'off', | 
					
						
							|  |  |  |         'import/no-dynamic-require': 'off', | 
					
						
							|  |  |  |         'no-underscore-dangle': 'off', | 
					
						
							|  |  |  |         'prefer-template': 'off', | 
					
						
							|  |  |  |         'consistent-return': 'off', | 
					
						
							|  |  |  |         'no-continue': 'off', | 
					
						
							|  |  |  |         'object-shorthand': 'off', | 
					
						
							|  |  |  |         'one-var': 'off', | 
					
						
							|  |  |  |         'prefer-const': 'off', | 
					
						
							|  |  |  |         'spaced-comment': 'off', | 
					
						
							|  |  |  |         'no-loop-func': 'off', | 
					
						
							|  |  |  |         'arrow-body-style': 'off', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         'guard-for-in': 'off', | 
					
						
							|  |  |  |         'no-return-assign': 'off', | 
					
						
							|  |  |  |         'dot-notation': 'off', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         'func-names': 'off', | 
					
						
							|  |  |  |         'import/no-useless-path-segments': 'off', | 
					
						
							|  |  |  |         'default-param-last': 'off', | 
					
						
							|  |  |  |         'prefer-arrow-callback': 'off', | 
					
						
							|  |  |  |         'no-unneeded-ternary': 'off', | 
					
						
							|  |  |  |         'no-return-await': 'off', | 
					
						
							|  |  |  |         'import/extensions': 'off', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         'no-var': 'off', | 
					
						
							|  |  |  |         'import/newline-after-import': 'off', | 
					
						
							|  |  |  |         'no-restricted-globals': 'off', | 
					
						
							|  |  |  |         'operator-assignment': 'off', | 
					
						
							|  |  |  |         'no-eval': 'off', | 
					
						
							|  |  |  |         'max-classes-per-file': 'off', | 
					
						
							|  |  |  |         'vars-on-top': 'off', | 
					
						
							|  |  |  |         'no-bitwise': 'off', | 
					
						
							|  |  |  |         'no-lonely-if': 'off', | 
					
						
							|  |  |  |         'no-multi-assign': 'off', | 
					
						
							|  |  |  |         'no-promise-executor-return': 'off', | 
					
						
							|  |  |  |         'no-empty-function': 'off', | 
					
						
							|  |  |  |         'import/no-unresolved': 'off', | 
					
						
							|  |  |  |         camelcase: 'off', | 
					
						
							|  |  |  |         eqeqeq: 'off', | 
					
						
							|  |  |  |         'lines-between-class-members': 'off', | 
					
						
							|  |  |  |         'import/no-cycle': 'off', | 
					
						
							|  |  |  |         'new-cap': 'off', | 
					
						
							|  |  |  |         'prefer-object-spread': 'off', | 
					
						
							|  |  |  |         'no-new-func': 'off', | 
					
						
							|  |  |  |         'no-unused-expressions': 'off', | 
					
						
							|  |  |  |         'lines-around-directive': 'off', | 
					
						
							|  |  |  |         'prefer-exponentiation-operator': 'off', | 
					
						
							|  |  |  |         'no-restricted-properties': 'off', | 
					
						
							|  |  |  |         'prefer-rest-params': 'off', | 
					
						
							|  |  |  |         'no-unreachable-loop': 'off', | 
					
						
							|  |  |  |         'no-alert': 'off', | 
					
						
							|  |  |  |         'no-useless-return': 'off', | 
					
						
							|  |  |  |         'no-nested-ternary': 'off', | 
					
						
							|  |  |  |         'prefer-regex-literals': 'off', | 
					
						
							|  |  |  |         'import/no-named-as-default-member': 'off', | 
					
						
							|  |  |  |         yoda: 'off', | 
					
						
							|  |  |  |         'no-script-url': 'off', | 
					
						
							| 
									
										
										
										
											2023-04-11 00:37:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-11 00:16:49 +08:00
										 |  |  |     }, | 
					
						
							|  |  |  | }; |