UNPKG

budoux

Version:
75 lines (68 loc) 2.34 kB
import prettier from "eslint-plugin-prettier"; import tsParser from "@typescript-eslint/parser"; import path from "node:path"; import { fileURLToPath } from "node:url"; import js from "@eslint/js"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all }); export default [{ ignores: ["**/bundle", "**/dist", "**/module", "src/data"], }, ...compat.extends("eslint:recommended", "prettier"), { plugins: { prettier, }, rules: { "prettier/prettier": "error", "block-scoped-var": "error", eqeqeq: "error", "no-var": "error", "prefer-const": "error", "eol-last": "error", "prefer-arrow-callback": "error", "no-trailing-spaces": "error", quotes: ["warn", "single", { avoidEscape: true, }], "no-restricted-properties": ["error", { object: "describe", property: "only", }, { object: "it", property: "only", }], }, }, ...compat.extends("plugin:@typescript-eslint/recommended").map(config => ({ ...config, files: ["**/*.ts", "**/*.tsx"], })), { files: ["**/*.ts", "**/*.tsx"], languageOptions: { parser: tsParser, ecmaVersion: 2018, sourceType: "module", }, rules: { "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-warning-comments": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/ban-types": "off", "@typescript-eslint/camelcase": "off", "node/no-empty-function": "off", "node/no-missing-import": "off", "node/no-unsupported-features/es-syntax": "off", "node/no-missing-require": "off", "node/shebang": "off", "no-dupe-class-members": "off", "require-atomic-updates": "off", }, }];