diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 7f77746..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "ignores": [ - "**/node_modules/**/*.js", - "src/thirdparty/**", - "src/**/*-min.js", - "src/**/*.min.js" - ], - "rules": { - "no-caller": 2, - "no-control-regex": 2, - "no-empty": 1, - "no-invalid-regexp": 2, - "no-regex-spaces": 2, - "no-unsafe-negation": 1, - "valid-jsdoc": 0, - "valid-typeof": 2, - "curly": 2, - "eqeqeq": [2, "smart"], - "guard-for-in": 0, - "no-else-return": 1, - "no-fallthrough": 2, - "no-invalid-this": 1, - "no-iterator": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-new-func": 2, - "no-new-wrappers": 2, - "no-new": 2, - "no-proto": 2, - "no-redeclare": 1, - "no-script-url": 2, - "wrap-iife": [2, "outside"], - "strict": 2, - "no-shadow-restricted-names": 2, - "no-shadow": 1, - "no-undef": 2, - "no-unused-vars": [1, {"vars": "all", "args": "none"}], - "no-use-before-define": 0, - "no-new-require": 2, - "block-spacing": 1, - "brace-style": [1, "1tbs", { "allowSingleLine": true }], - "camelcase": 1, - "comma-dangle": 2, - "comma-spacing": 1, - "comma-style": [1, "last"], - "computed-property-spacing": 1, - "eol-last": 1, - "func-call-spacing": 1, - "indent": [1, 4], - "key-spacing": [1, { "beforeColon": false, "afterColon": true }], - "max-len": [1, 120], - "new-cap": [0, { - "capIsNewExceptions": [ - "$.Deferred", - "$.Event", - "CodeMirror.Pos", - "Immutable.Map", - "Immutable.List", - "JSLINT" - ] - }], - "new-parens": 2, - "no-bitwise": 2, - "no-new-object": 2, - "no-trailing-spaces": 1, - "semi-spacing": 1, - "semi": 2 - }, - "globals": { - "console": true - }, - "env":{ - "es6": true, - "node": true - }, - "parserOptions": { - "ecmaVersion": 10, - "sourceType": "module", - "ecmaFeatures": { - "arrowFunctions": true, - "binaryLiterals": true, - "blockBindings": true, - "classes": true - } - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..6ac0508 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,80 @@ +// eslint.config.js +export default { + files: ['src/**', 'test/**'], + ignores: [ + '**/node_modules/**', + 'src/thirdparty/**', + 'src/**/*-min.js', + 'src/**/*.min.js' + ], + languageOptions: { + ecmaVersion: 2022, // Automatically sets up appropriate ECMAScript features + sourceType: 'module', + globals: { + process: true, // Assume process is a global variable (specific to Node.js) + setTimeout: true, // Assume setTimeout is a global variable + console: true + } + }, + rules: { + 'no-caller': 'error', + 'no-control-regex': 'error', + 'no-empty': 'warn', + 'no-invalid-regexp': 'error', + 'no-regex-spaces': 'error', + 'no-unsafe-negation': 'warn', + 'valid-jsdoc': 'off', + 'valid-typeof': 'error', + 'curly': 'error', + 'eqeqeq': ['error', 'smart'], + 'guard-for-in': 'off', + 'no-else-return': 'warn', + 'no-fallthrough': 'error', + 'no-invalid-this': 'warn', + 'no-iterator': 'error', + 'no-loop-func': 'error', + 'no-multi-str': 'error', + 'no-new-func': 'error', + 'no-new-wrappers': 'error', + 'no-new': 'error', + 'no-proto': 'error', + 'no-redeclare': 'warn', + 'no-script-url': 'error', + 'wrap-iife': ['error', 'outside'], + 'strict': 'error', + 'no-shadow-restricted-names': 'error', + 'no-shadow': 'warn', + 'no-undef': 'error', + 'no-unused-vars': ['warn', {'vars': 'all', 'args': 'none'}], + 'no-use-before-define': 'off', + 'no-new-require': 'error', + 'block-spacing': 'warn', + 'brace-style': ['warn', '1tbs', { 'allowSingleLine': true }], + 'camelcase': 'warn', + 'comma-dangle': 'error', + 'comma-spacing': 'warn', + 'comma-style': ['warn', 'last'], + 'computed-property-spacing': 'warn', + 'eol-last': 'warn', + 'func-call-spacing': 'warn', + 'indent': ['warn', 4], + 'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true }], + 'max-len': ['warn', 120], + 'new-cap': ['off', { + 'capIsNewExceptions': [ + '$.Deferred', + '$.Event', + 'CodeMirror.Pos', + 'Immutable.Map', + 'Immutable.List', + 'JSLINT' + ] + }], + 'new-parens': 'error', + 'no-bitwise': 'error', + 'no-new-object': 'error', + 'no-trailing-spaces': 'warn', + 'semi-spacing': 'warn', + 'semi': 'error' + } +};