-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (61 loc) · 2.16 KB
/
Copy patheslint.config.js
File metadata and controls
62 lines (61 loc) · 2.16 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
55
56
57
58
59
60
61
62
// @ts-check
import { defineConfig } from "eslint/config";
import { dirname } from "path";
import { fileURLToPath } from "url";
import { TypeSpecCommonEslintConfigs } from "./core/eslint.config.js";
export default defineConfig(
{
ignores: [
"**/dist/**/*",
"**/.temp/**/*",
"**/temp/**/*",
"**/generated-defs/*",
"**/website/build/**/*",
"**/.astro/**/*",
"core/**/*", // The TypeSpec core submodule has its own ESLint config - don't lint it from here to avoid OOM
"**/venv/**/*", // Ignore python virtual env
"**/.vscode-test-web/**/*", // Ignore VSCode test web project
// TODO: enable
"**/.scripts/**/*",
"eng/scripts/**/*",
"packages/*/scripts/**/*",
"packages/typespec-ts/test/*/generated/**/*",
"packages/typespec-ts/src/modular/static/**/*",
],
},
...TypeSpecCommonEslintConfigs,
{
// typespec-ts has static helper files which are copied verbatim into generated output and
// intentionally keep camelCase names to match the upstream Azure SDK sources.
files: ["packages/typespec-ts/static/**/*.ts", "packages/typespec-ts/static/**/*.mts"],
rules: {
"unicorn/filename-case": "off",
},
},
{
// Generated by `npm run gen:scenario-suites`. The file names encode the scenario
// directory tree with `__` separators (e.g. `models__nested-enum__not-flatten`), so
// they intentionally don't follow kebab-case.
files: ["packages/typespec-ts/test/modular-unit/scenario-suites/**/*.test.ts"],
rules: {
"unicorn/filename-case": "off",
},
},
{
// Disable these project-aware rules for typespec-ts to prevent OOM
files: ["packages/!(typespec-ts)/src/**/*.ts", "packages/!(typespec-ts)/src/**/*.tsx"],
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["packages/*/vitest.config.ts"],
},
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)),
},
},
rules: {
// Only put rules here that need typescript project information
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-deprecated": "warn",
},
},
);