Skip to content

Commit

Permalink
Migrate to ESLint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
hobinjk-ptc committed Jun 10, 2024
1 parent 3b3e9db commit 2478f2b
Show file tree
Hide file tree
Showing 10 changed files with 297 additions and 467 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

78 changes: 0 additions & 78 deletions .eslintrc-web.js

This file was deleted.

47 changes: 0 additions & 47 deletions .eslintrc.js

This file was deleted.

78 changes: 78 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import js from '@eslint/js';
import globals from 'globals';

export default [
{
ignores: [
'**/dropzone.js',
'interfaces/MIR100/index_old.js',
'interfaces/robot',
'**/*.min.js',
'tools/machine-gltf/resources',
'tools/motion/assets',
'tools/motion/js',
'tools/pushMe/resources',
'tools/spatialDraw/resources',
'tools/spatialAnalytics/resources',
'tools/spatialSensor/resources',
'tools/sphere/resources',
'tools/path/js/THREE.MeshLine.js',
'tools/path/thirdPartyCode',
'tools/pathPoint/resources',
'tools/path/resources',
],
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2018,
globals: {
...globals.node,
...globals.browser,
Atomics: 'readonly',
THREE: 'readonly',
SharedArrayBuffer: 'readonly',
// Constants from server's objectDefaultFiles/object.js and
// related files
Envelope: 'readonly',
EnvelopeContents: 'readonly',
LanguageInterface: 'readonly',
SpatialInterface: 'readonly',
ThreejsInterface: 'readonly',
spatialObject: 'readonly',
},
},
rules: {
'indent': [
'warn',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'warn',
'single'
],
'semi': [
'warn',
'always'
],
'comma-spacing': [
'warn', {before: false, after: true}
],
'key-spacing': 'warn',
'keyword-spacing': 'warn',
'no-trailing-spaces': 'warn',
'brace-style': ['warn', '1tbs', {allowSingleLine: true}],
'space-before-blocks': 'warn',
'space-infix-ops': 'warn',
'no-prototype-builtins': 'off',
'no-unused-vars': ['warn', {argsIgnorePattern: '^_', varsIgnorePattern: '^_'}],
'no-redeclare': 'warn',
'no-inner-declarations': 'warn',
'no-extra-semi': 'warn',
},
}
];
4 changes: 2 additions & 2 deletions interfaces/kepware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ if (exports.enabled) {
*/
this.error = function(_err) {
// console.error('kepware error', err); // todo err just outputs a gigantic json object. Needs some more specifics.
console.error('cant find kepware server: \033[33m' + kepwareServerName + '\033[0m with the IP: \033[33m' + kepwareServerIP + '\033[0m');
console.error('cant find kepware server: \u001b[33m' + kepwareServerName + '\u001b[0m with the IP: \u001b[33m' + kepwareServerIP + '\u001b[0m');
};
}

setup();
}
}
Loading

0 comments on commit 2478f2b

Please sign in to comment.