|
| 1 | +// import jsdoc from "eslint-plugin-jsdoc"; |
| 2 | +import globals from "globals"; |
| 3 | +import path from "node:path"; |
| 4 | +import { fileURLToPath } from "node:url"; |
| 5 | +import js from "@eslint/js"; |
| 6 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 7 | + |
| 8 | +const __filename = fileURLToPath(import.meta.url); |
| 9 | +const __dirname = path.dirname(__filename); |
| 10 | +const compat = new FlatCompat({ |
| 11 | + baseDirectory: __dirname, |
| 12 | + recommendedConfig: js.configs.recommended, |
| 13 | + allConfig: js.configs.all |
| 14 | +}); |
| 15 | + |
| 16 | +export default [{ |
| 17 | + ignores: ["src/hanabi-bot.js"], |
| 18 | +}, ...compat.extends("eslint:recommended", "plugin:jsdoc/recommended"), { |
| 19 | + // plugins: { |
| 20 | + // jsdoc, |
| 21 | + // }, |
| 22 | + languageOptions: { |
| 23 | + globals: { |
| 24 | + ...globals.node, |
| 25 | + ...globals.commonjs, |
| 26 | + }, |
| 27 | + ecmaVersion: "latest", |
| 28 | + sourceType: "module", |
| 29 | + }, |
| 30 | + settings: { |
| 31 | + jsdoc: { |
| 32 | + tagNamePreference: { |
| 33 | + augments: "extends", |
| 34 | + }, |
| 35 | + }, |
| 36 | + }, |
| 37 | + rules: { |
| 38 | + "indent": ["error", "tab", { SwitchCase: 1, ignoredNodes: ["ConditionalExpression"] }], |
| 39 | + "no-unused-vars": ["error", { argsIgnorePattern: "^_" }], |
| 40 | + "semi": "error", |
| 41 | + "eol-last": "warn", |
| 42 | + "no-trailing-spaces": ["warn", { ignoreComments: true }], |
| 43 | + "prefer-const": "warn", |
| 44 | + "curly": ["warn", "multi-or-nest", "consistent"], |
| 45 | + "jsdoc/require-jsdoc": "off", |
| 46 | + "jsdoc/require-property-description": "off", |
| 47 | + "jsdoc/require-param-description": "off", |
| 48 | + "jsdoc/require-returns-description": "off", |
| 49 | + "jsdoc/require-returns": "off", |
| 50 | + "jsdoc/require-returns-type": "off", |
| 51 | + "jsdoc/tag-lines": "off", |
| 52 | + "jsdoc/no-undefined-types": "warn", |
| 53 | + "jsdoc/check-property-names": "off", |
| 54 | + "jsdoc/valid-types": "off" |
| 55 | + } |
| 56 | +}]; |
0 commit comments