UNPKG

1.63 kBJavaScriptView Raw
1module.exports = {
2 parser: "@typescript-eslint/parser", // Specifies the ESLint parser
3 parserOptions: {
4 ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
5 sourceType: "module", // Allows for the use of imports
6 project: "./tsconfig.json",
7 },
8 extends: [
9 "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
10 "prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
11 "plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
12 ],
13 plugins: [],
14 rules: {
15 "@typescript-eslint/no-parameter-properties": "off",
16 "@typescript-eslint/no-explicit-any": "off",
17 "@typescript-eslint/no-use-before-define": [
18 "error",
19 {
20 functions: false,
21 typedefs: false,
22 classes: false,
23 },
24 ],
25 "@typescript-eslint/no-unused-vars": [
26 "error",
27 {
28 ignoreRestSiblings: true,
29 argsIgnorePattern: "^_",
30 },
31 ],
32 "@typescript-eslint/explicit-function-return-type": [
33 "warn",
34 {
35 allowExpressions: true,
36 allowTypedFunctionExpressions: true,
37 },
38 ],
39 "@typescript-eslint/no-object-literal-type-assertion": "off",
40 "@typescript-eslint/interface-name-prefix": "off",
41 "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()!
42 },
43 overrides: [
44 {
45 files: ["*.test.ts"],
46 rules: {
47 "@typescript-eslint/explicit-function-return-type": "off",
48 },
49 },
50 ],
51};