|
| 1 | +// SPDX-FileCopyrightText: Copyright (c) 2024-2025 Objectionary.com |
| 2 | +// SPDX-License-Identifier: MIT |
| 3 | + |
| 4 | +const eslint = require("@eslint/js"); |
| 5 | +const tseslint = require("@typescript-eslint/eslint-plugin"); |
| 6 | +const tsparser = require("@typescript-eslint/parser"); |
| 7 | + |
| 8 | +module.exports = [ |
| 9 | + { |
| 10 | + ignores: [ |
| 11 | + "node_modules/**", |
| 12 | + "out/**", |
| 13 | + "src/parser/**", |
| 14 | + "compiled/**", |
| 15 | + "tsc-compiled/**", |
| 16 | + "dist/**", |
| 17 | + "bin/**", |
| 18 | + "coverage/**" |
| 19 | + ] |
| 20 | + }, |
| 21 | + eslint.configs.recommended, |
| 22 | + { |
| 23 | + files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], |
| 24 | + languageOptions: { |
| 25 | + parser: tsparser, |
| 26 | + parserOptions: { |
| 27 | + ecmaVersion: "latest", |
| 28 | + sourceType: "module" |
| 29 | + }, |
| 30 | + globals: { |
| 31 | + console: "readonly", |
| 32 | + process: "readonly", |
| 33 | + Buffer: "readonly", |
| 34 | + __dirname: "readonly", |
| 35 | + __filename: "readonly", |
| 36 | + exports: "writable", |
| 37 | + module: "writable", |
| 38 | + require: "readonly", |
| 39 | + global: "readonly", |
| 40 | + setTimeout: "readonly", |
| 41 | + clearTimeout: "readonly", |
| 42 | + setInterval: "readonly", |
| 43 | + clearInterval: "readonly" |
| 44 | + } |
| 45 | + }, |
| 46 | + plugins: { |
| 47 | + "@typescript-eslint": tseslint |
| 48 | + }, |
| 49 | + rules: { |
| 50 | + "no-undef": "off", |
| 51 | + "no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }], |
| 52 | + semi: [2, "always"], |
| 53 | + "consistent-return": "off", |
| 54 | + "no-process-exit": "off", |
| 55 | + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }], |
| 56 | + "@typescript-eslint/no-explicit-any": 0, |
| 57 | + "padding-line-between-statements": "off", |
| 58 | + "@typescript-eslint/explicit-module-boundary-types": 0, |
| 59 | + "@typescript-eslint/no-non-null-assertion": 0, |
| 60 | + "jsdoc/require-param-type": "off", |
| 61 | + "jsdoc/require-returns-type": "off", |
| 62 | + "jsdoc/require-hyphen-before-param-description": "off", |
| 63 | + "jsdoc/newline-after-description": "off" |
| 64 | + } |
| 65 | + }, |
| 66 | + { |
| 67 | + files: ["**/*.test.ts", "**/*.test.js", "**/*.spec.ts", "**/*.spec.js", "test/**/*.ts", "test/**/*.js"], |
| 68 | + languageOptions: { |
| 69 | + globals: { |
| 70 | + describe: "readonly", |
| 71 | + test: "readonly", |
| 72 | + it: "readonly", |
| 73 | + expect: "readonly", |
| 74 | + beforeEach: "readonly", |
| 75 | + afterEach: "readonly", |
| 76 | + beforeAll: "readonly", |
| 77 | + afterAll: "readonly", |
| 78 | + jest: "readonly" |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | +]; |
0 commit comments