|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +/** @type {import("eslint").Linter.Config} */ |
| 4 | +const config = { |
| 5 | + extends: [ |
| 6 | + "eslint:recommended", |
| 7 | + "plugin:@typescript-eslint/recommended", |
| 8 | + "plugin:node/recommended", |
| 9 | + "prettier", |
| 10 | + ], |
| 11 | + plugins: ["@babel/development"], |
| 12 | + parser: "@typescript-eslint/parser", |
| 13 | + reportUnusedDisableDirectives: true, |
| 14 | + rules: { |
| 15 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 16 | + "@typescript-eslint/no-unused-vars": [ |
| 17 | + "warn", |
| 18 | + { |
| 19 | + varsIgnorePattern: "^_", |
| 20 | + argsIgnorePattern: "^_", |
| 21 | + caughtErrorsIgnorePattern: "^_", |
| 22 | + }, |
| 23 | + ], |
| 24 | + "no-constant-condition": [ |
| 25 | + "error", |
| 26 | + { |
| 27 | + checkLoops: false, |
| 28 | + }, |
| 29 | + ], |
| 30 | + "node/no-unsupported-features/es-syntax": "off", |
| 31 | + // Specifying *.js for *.ts doesn't work now |
| 32 | + "node/no-missing-import": "off", |
| 33 | + // Disabling it until it skips type-only imports |
| 34 | + "node/no-unpublished-import": "off", |
| 35 | + // We target newer Node, so this is unnecessary |
| 36 | + "no-inner-declarations": "off", |
| 37 | + }, |
| 38 | + overrides: [ |
| 39 | + { |
| 40 | + files: ["src/**/*.ts"], |
| 41 | + extends: [ |
| 42 | + "plugin:@typescript-eslint/recommended-requiring-type-checking", |
| 43 | + ], |
| 44 | + parserOptions: { |
| 45 | + project: ["./tsconfig.json"], |
| 46 | + tsconfigRootDir: __dirname, |
| 47 | + }, |
| 48 | + }, |
| 49 | + { |
| 50 | + files: ["*.test.ts"], |
| 51 | + extends: ["plugin:jest/recommended"], |
| 52 | + rules: { |
| 53 | + "node/no-unpublished-import": "off", |
| 54 | + }, |
| 55 | + }, |
| 56 | + ], |
| 57 | + ignorePatterns: ["cjs/dist/**/*", "dist/**/*", "coverage/**/*"], |
| 58 | +}; |
| 59 | +module.exports = config; |
0 commit comments