-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy patheslint.config.js
More file actions
54 lines (50 loc) · 2.11 KB
/
eslint.config.js
File metadata and controls
54 lines (50 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// @ts-check
// This file contents based on:
// https://typescript-eslint.io/getting-started#step-2-configuration
// https://typescript-eslint.io/getting-started/typed-linting
// This file must be in CommonJS format ('require()') instead of ESModules ('import') due to how it is consumed
// by openapi-alps:
// https://github.com/Azure/openapi-diff/pull/335/files#r1649413983
const eslint = require("@eslint/js")
const tseslint = require("typescript-eslint")
module.exports = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
// Note: __dirname is coming CommonJS:
// https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules
// as linked from: https://typescript-eslint.io/getting-started/typed-linting
tsconfigRootDir: __dirname
}
}
},
{
// Based on https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
ignores: ["**/dist", "eslint.config.js", "coverage/**"]
},
{
rules: {
// Rules disabled as part of migration from tslint
// https://github.com/Azure/openapi-diff/pull/335
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"no-constant-condition": "off",
"no-useless-escape": "off",
"prefer-const": "off",
// New v10 recommended rule requiring "{ cause }" on re-thrown errors. Disabled because
// this project targets ES2017, and TypeScript lacks the ErrorOptions type at that target level.
"preserve-caught-error": "off"
}
}
)