|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +// This file contents based on: |
| 4 | +// https://typescript-eslint.io/getting-started#step-2-configuration |
| 5 | +// https://typescript-eslint.io/getting-started/typed-linting |
| 6 | + |
| 7 | +import eslint from "@eslint/js" |
| 8 | +import { dirname } from "path" |
| 9 | +import tseslint from "typescript-eslint" |
| 10 | +import { fileURLToPath } from "url" |
| 11 | + |
| 12 | +// Needed to support Node < 20.11 per: |
| 13 | +// https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules |
| 14 | +// as linked from: https://typescript-eslint.io/getting-started/typed-linting |
| 15 | +const __dirname = dirname(fileURLToPath(import.meta.url)) |
| 16 | + |
| 17 | +export default tseslint.config( |
| 18 | + eslint.configs.recommended, |
| 19 | + ...tseslint.configs.recommendedTypeChecked, |
| 20 | + { |
| 21 | + languageOptions: { |
| 22 | + parserOptions: { |
| 23 | + project: true, |
| 24 | + tsconfigRootDir: __dirname |
| 25 | + } |
| 26 | + } |
| 27 | + }, |
| 28 | + { |
| 29 | + // Based on https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores |
| 30 | + ignores: ["**/dist"] |
| 31 | + }, |
| 32 | + { |
| 33 | + rules: { |
| 34 | + // Rules disabled as part of migration from tslint |
| 35 | + // https://github.com/Azure/openapi-diff/pull/335 |
| 36 | + "@typescript-eslint/no-explicit-any": "off", |
| 37 | + "@typescript-eslint/no-unnecessary-type-assertion": "off", |
| 38 | + "@typescript-eslint/no-unsafe-argument": "off", |
| 39 | + "@typescript-eslint/no-unsafe-assignment": "off", |
| 40 | + "@typescript-eslint/no-unsafe-call": "off", |
| 41 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 42 | + "@typescript-eslint/no-unsafe-return": "off", |
| 43 | + "@typescript-eslint/no-unused-vars": "off", |
| 44 | + "@typescript-eslint/no-var-requires": "off", |
| 45 | + "@typescript-eslint/restrict-template-expressions": "off", |
| 46 | + "no-constant-condition": "off", |
| 47 | + "no-useless-escape": "off", |
| 48 | + "prefer-const": "off" |
| 49 | + } |
| 50 | + } |
| 51 | +) |
0 commit comments