diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9e6406a..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/**/program.invalid.js \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index c0b1bf5..0000000 --- a/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": [ - "@playcanvas/eslint-config" - ], - "rules": { - "no-unused-expressions": "off", - "jsdoc/check-tag-names": "off", - "import/no-unresolved": "off" - }, - "overrides": [ - { - "files": ["./**/*.test.js"], - "rules": { - "prefer-arrow-callback": "off", - } - } - ] - } - \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..9d5156c --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,35 @@ +import playcanvasConfig from '@playcanvas/eslint-config'; +import globals from 'globals'; + +export default [ + ...playcanvasConfig, + { + ignores: ['**/program.invalid.js'] // Exclude specific files + }, + { + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + globals: { + ...globals.browser, + ...globals.mocha, + ...globals.node + } + } + }, + { + rules: { + 'no-unused-expressions': 'off', + 'jsdoc/check-tag-names': 'off', + 'import/no-unresolved': 'off' + } + }, + { + // Configuration specific to test files + files: ['**/*.test.js'], // Match test files + + rules: { + 'prefer-arrow-callback': 'off' // Allow function expressions in test files + } + } +]; diff --git a/src/utils/tag-utils.js b/src/utils/tag-utils.js index ba0b167..fe1ebb5 100644 --- a/src/utils/tag-utils.js +++ b/src/utils/tag-utils.js @@ -24,12 +24,12 @@ export function parseTag(input = '') { try { const arr = parseStringToNumericalArray(input); if (Array.isArray(arr)) return arr; - } catch { /* eslint-disable-next-line no-empty */ } + } catch { } try { const arr = JSON.parse(input); if (Array.isArray(arr)) return arr; - } catch { /* eslint-disable-next-line no-empty */ } + } catch { } // If none of the above, return the string return input; diff --git a/src/utils/ts-utils.js b/src/utils/ts-utils.js index 2b3cae1..0f54c0f 100644 --- a/src/utils/ts-utils.js +++ b/src/utils/ts-utils.js @@ -5,8 +5,8 @@ import * as ts from 'typescript'; import { ParsingError } from '../parsers/parsing-error.js'; export function createDefaultMapFromCDN(options, prefix, ts) { - var fsMap = new Map(); - var files = knownLibFilesForCompilerOptions(options, ts); + const fsMap = new Map(); + const files = knownLibFilesForCompilerOptions(options, ts); async function uncached() { const contentPromises = files.map((lib) => {