src/bindings/js/docs/CODESTYLE.md
Node.js bindings contain two parts: C++ and Typescript/JavaScript.
This article presents the coding standards for JavaScript and TypeScript parts of openvino-node package. The following rules will help maintain code quality and consistency throughout the codebase.
For C++ codestyle rules, refer to this document.
Make sure your IDE has ESLint plugin installed. Its rules are specified in the .eslint-global.js file. Keep in mind that your PR will not be approved if it does not meet the following requirements.
semi: ['error']let or const instead of var.no-var: ['error']max-len: ['error']eol-last: ['error']indent: ['error', 2]camelcase: ['error']semi-spacing: ['error']arrow-spacing: ['error']comma-spacing: ['error']no-multi-spaces: ['error']quotes: ['error', 'single']no-trailing-spaces: ['error']space-before-blocks: ['error']newline-before-return: ['error']comma-dangle: ['error', 'always-multiline']space-before-function-paren: ['error', { named: 'never', anonymous: 'never', asyncArrow: 'always' }]key-spacing: ['error', { beforeColon: false }]no-multiple-empty-lines: ['error', { max: 1, maxBOF: 0, maxEOF: 0 }]catch keyword: No space after catchkeyword-spacing: ['error', { overrides: { catch: { after: false } } }]For further details on each rule, refer to the ESLint documentation.