Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'standard',
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.www.json'] // Include both TypeScript configs
},
plugins: ['@typescript-eslint'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'func-style': ['error', 'expression'],
semi: ['error', 'always'],
quotes: ['error', 'single'],
indent: ['error', 2],
'brace-style': ['error', '1tbs'],
'no-var': 'error',
'prefer-const': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'no-unused-vars': 'off', // Turn off the base rule as it can report incorrect errors
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}],
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off'
},
overrides: [
{
files: ['.eslintrc.cjs', 'vite.config.js', 'vite.worker.config.js', 'scripts/*', 'www/lib/*'],
env: {
node: true
},
parserOptions: {
sourceType: 'script',
project: null // Disable TypeScript parsing for these files
}
},
{
files: ['www/**/*.js', 'www/**/*.ts'],
parserOptions: {
project: './tsconfig.www.json' // Use tsconfig.www.json for files in the www directory
}
},
{
files: ['src/**/*.ts'],
parserOptions: {
project: './tsconfig.json' // Use main tsconfig.json for files in the src directory
}
}
]
};
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ dist/*.min.js
dist/tensorflow.js
dist/tensorflow.commonjs2.js
www/trainingData/*.png
www/trainingData/*.db
www/trainingData/*.db
www/lib/*
!www/lib/d3.v3.min.js
Loading