mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
* initial commit for Node.js binding * add c++ code * add inference session impl * e2e working * add settings.json * add test data * adjust binding declaration * refine tensor constructor declaration * update tests * enable onnx tests * simply refine readme * refine cpp impl * refine tests * formatting * add linting * move bin folder * fix linux build * manually update test filter list * update C++ API headers: fix crash in release build * make (manually) prebuild work * add test into prepack script * specify prebuild runtime type (N-API) * build.ts: update rebuild and include regex * fix lazy load on electron.js * update dev version, git link and binary host * support session options and run options * bump dev version * update README * add 1 example * move folder * adjust path * update document for examples * rename example 01 * add example 02 * add session option: log severity level * add example 04 * resolve comments * fix typo * remove double guard in header files * add copyright banner * move BUILD outside from README * consume test filter list from onnxruntime
123 lines
4.5 KiB
JavaScript
123 lines
4.5 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
ignorePatterns: ['**/*.js', 'node_modules/', 'types/'],
|
|
env: { 'es6': true, 'node': true },
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: { 'project': 'tsconfig.json', 'sourceType': 'module' },
|
|
plugins: ['@typescript-eslint', 'prefer-arrow', 'import', 'jsdoc'],
|
|
rules: {
|
|
'@typescript-eslint/array-type': ['error', { 'default': 'array-simple' }],
|
|
'@typescript-eslint/await-thenable': 'error',
|
|
'@typescript-eslint/ban-types': [
|
|
'error', {
|
|
'types': {
|
|
'Object': { 'message': 'Use {} instead.' },
|
|
'String': { 'message': 'Use \'string\' instead.' },
|
|
'Number': { 'message': 'Use \'number\' instead.' },
|
|
'Boolean': { 'message': 'Use \'boolean\' instead.' }
|
|
}
|
|
}
|
|
],
|
|
'@typescript-eslint/camelcase': 'error',
|
|
'@typescript-eslint/class-name-casing': 'error',
|
|
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
'@typescript-eslint/interface-name-prefix': 'error',
|
|
'@typescript-eslint/member-delimiter-style': [
|
|
'error', {
|
|
'multiline': { 'delimiter': 'semi', 'requireLast': true },
|
|
'singleline': { 'delimiter': 'semi', 'requireLast': false }
|
|
}
|
|
],
|
|
'@typescript-eslint/no-empty-function': 'error',
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
'@typescript-eslint/no-inferrable-types': 'error',
|
|
'@typescript-eslint/no-misused-new': 'error',
|
|
'@typescript-eslint/no-namespace': 'off',
|
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
'@typescript-eslint/no-param-reassign': 'off',
|
|
'@typescript-eslint/no-require-imports': 'error',
|
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
'@typescript-eslint/promise-function-async': 'off',
|
|
'@typescript-eslint/quotes': ['error', 'single'],
|
|
'@typescript-eslint/restrict-plus-operands': 'error',
|
|
'@typescript-eslint/semi': ['error', 'always'],
|
|
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
'@typescript-eslint/triple-slash-reference':
|
|
['error', { 'path': 'always', 'types': 'prefer-import', 'lib': 'always' }],
|
|
'arrow-body-style': 'error',
|
|
'camelcase': 'error',
|
|
'constructor-super': 'error',
|
|
'curly': 'error',
|
|
'default-case': 'error',
|
|
'dot-notation': 'error',
|
|
'eqeqeq': ['error', 'smart'],
|
|
'guard-for-in': 'off',
|
|
'id-match': 'error',
|
|
'max-len': ['error', { 'code': 120 }],
|
|
'new-parens': 'error',
|
|
'no-bitwise': 'off',
|
|
'no-caller': 'error',
|
|
'no-cond-assign': 'off',
|
|
'no-console': 'off',
|
|
'no-constant-condition': 'error',
|
|
'no-control-regex': 'error',
|
|
'no-debugger': 'error',
|
|
'no-duplicate-case': 'error',
|
|
'no-empty': 'off',
|
|
'no-eval': 'error',
|
|
'no-extra-bind': 'error',
|
|
'no-invalid-regexp': 'error',
|
|
'no-invalid-this': 'error',
|
|
'no-multiple-empty-lines': 'error',
|
|
'no-new-func': 'error',
|
|
'no-new-wrappers': 'error',
|
|
'no-octal': 'error',
|
|
'no-octal-escape': 'error',
|
|
'no-redeclare': 'error',
|
|
'no-regex-spaces': 'error',
|
|
'no-return-await': 'error',
|
|
'no-sparse-arrays': 'error',
|
|
'no-template-curly-in-string': 'error',
|
|
'no-throw-literal': 'error',
|
|
'no-undef-init': 'error',
|
|
'no-underscore-dangle': 'error',
|
|
'no-unsafe-finally': 'error',
|
|
'no-unused-expressions': 'off',
|
|
'no-unused-labels': 'error',
|
|
'no-var': 'error',
|
|
'object-shorthand': 'error',
|
|
'prefer-arrow/prefer-arrow-functions': 'error',
|
|
'prefer-const': 'error',
|
|
'radix': 'error',
|
|
'use-isnan': 'error'
|
|
},
|
|
overrides: [{
|
|
files: ['lib/**/*.ts'],
|
|
rules: {
|
|
'import/no-extraneous-dependencies': ['error', { 'devDependencies': false }],
|
|
'import/no-internal-modules': 'error',
|
|
'import/no-unassigned-import': 'error',
|
|
'jsdoc/check-alignment': 'error',
|
|
'jsdoc/check-indentation': 'error',
|
|
'jsdoc/newline-after-description': 'error',
|
|
}
|
|
}, {
|
|
files: ['script/**/*.ts', 'test/**/*.ts'], rules: {
|
|
'@typescript-eslint/camelcase': 'off',
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
'camelcase': 'off',
|
|
'prefer-arrow/prefer-arrow-functions': 'off',
|
|
}
|
|
}],
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
],
|
|
};
|