|
| 1 | +const { |
| 2 | + defineConfig, |
| 3 | + globalIgnores, |
| 4 | +} = require("eslint/config"); |
| 5 | + |
| 6 | +const tsParser = require("@typescript-eslint/parser"); |
| 7 | +const typescriptEslint = require("@typescript-eslint/eslint-plugin"); |
| 8 | +const prettier = require("eslint-plugin-prettier"); |
| 9 | +const globals = require("globals"); |
| 10 | +const js = require("@eslint/js"); |
| 11 | + |
| 12 | +const { |
| 13 | + FlatCompat, |
| 14 | +} = require("@eslint/eslintrc"); |
| 15 | + |
| 16 | +const compat = new FlatCompat({ |
| 17 | + baseDirectory: __dirname, |
| 18 | + recommendedConfig: js.configs.recommended, |
| 19 | + allConfig: js.configs.all |
| 20 | +}); |
| 21 | +const path = require("path"); |
| 22 | + |
| 23 | +module.exports = defineConfig([{ |
| 24 | + languageOptions: { |
| 25 | + parser: tsParser, |
| 26 | + sourceType: "module", |
| 27 | + |
| 28 | + parserOptions: { |
| 29 | + useJSXTextNode: true, |
| 30 | + project: [path.resolve(__dirname, "tsconfig.json")], |
| 31 | + }, |
| 32 | + |
| 33 | + globals: { |
| 34 | + ...globals.jasmine, |
| 35 | + ...globals.jest, |
| 36 | + }, |
| 37 | + }, |
| 38 | + |
| 39 | + plugins: { |
| 40 | + "@typescript-eslint": typescriptEslint, |
| 41 | + prettier, |
| 42 | + }, |
| 43 | + |
| 44 | + extends: compat.extends( |
| 45 | + "plugin:@typescript-eslint/recommended", |
| 46 | + "prettier", |
| 47 | + "plugin:prettier/recommended", |
| 48 | + ), |
| 49 | + |
| 50 | + rules: { |
| 51 | + "no-underscore-dangle": 0, |
| 52 | + "arrow-body-style": 0, |
| 53 | + "no-unused-expressions": 0, |
| 54 | + "no-plusplus": 0, |
| 55 | + "no-console": 0, |
| 56 | + "func-names": 0, |
| 57 | + |
| 58 | + "comma-dangle": ["error", { |
| 59 | + arrays: "always-multiline", |
| 60 | + objects: "always-multiline", |
| 61 | + imports: "always-multiline", |
| 62 | + exports: "always-multiline", |
| 63 | + functions: "ignore", |
| 64 | + }], |
| 65 | + |
| 66 | + "no-prototype-builtins": 0, |
| 67 | + "prefer-destructuring": 0, |
| 68 | + "no-else-return": 0, |
| 69 | + |
| 70 | + "lines-between-class-members": ["error", "always", { |
| 71 | + exceptAfterSingleLine: true, |
| 72 | + }], |
| 73 | + |
| 74 | + "@typescript-eslint/explicit-member-accessibility": 0, |
| 75 | + "@typescript-eslint/no-explicit-any": 0, |
| 76 | + "@typescript-eslint/no-inferrable-types": 0, |
| 77 | + "@typescript-eslint/explicit-function-return-type": 0, |
| 78 | + "@typescript-eslint/no-use-before-define": 0, |
| 79 | + "@typescript-eslint/no-empty-function": 0, |
| 80 | + "@typescript-eslint/camelcase": 0, |
| 81 | + "@typescript-eslint/ban-ts-comment": 0, |
| 82 | + }, |
| 83 | +}, globalIgnores(["lib/*", "es/*", "mjs/*", "node8/*", "**/jest.config.js"])]); |
0 commit comments