forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
80 lines (74 loc) · 2.33 KB
/
index.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: { project: "./tsconfig.json" },
plugins: ["@typescript-eslint/eslint-plugin", "prettier", "unicorn", "deprecation"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
env: {
node: true,
es2021: true,
},
rules: {
/**
* Typescript plugin overrides
*/
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ varsIgnorePattern: "^_", argsIgnorePattern: ".*", ignoreRestSiblings: true },
],
"@typescript-eslint/no-floating-promises": "error",
// This rule is bugged https://github.com/typescript-eslint/typescript-eslint/issues/6538
"@typescript-eslint/no-misused-promises": "off",
/**
* Unicorn
*/
"deprecation/deprecation": ["warn"],
/**
* Unicorn
*/
"unicorn/filename-case": ["error", { case: "kebabCase" }],
/**
* Core
*/
"no-inner-declarations": "off",
"no-empty": "off",
"no-constant-condition": "off",
"no-case-declarations": "off",
"no-ex-assign": "off",
"prefer-const": [
"warn",
{
destructuring: "all",
},
],
eqeqeq: ["warn", "always", { null: "ignore" }],
// Do not want console.log left from debugging or using console.log for logging. Use the program logger.
"no-console": "warn",
// Symbols should have a description so it can be serialized.
"symbol-description": "warn",
},
ignorePatterns: ["dist/**/*", "dist-dev/**/*"],
overrides: [
{
/**
* Test files specific rules
*/
files: ["**/*.test.ts"],
plugins: ["vitest"],
rules: {
"vitest/no-focused-tests": "warn",
"vitest/no-identical-title": "error",
"vitest/no-commented-out-tests": "warn",
"vitest/no-import-node-test": "warn",
"vitest/require-local-test-context-for-concurrent-snapshots": "warn",
"vitest/valid-describe-callback": "warn",
"vitest/valid-expect": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
},
},
],
};