-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy patheslint.config.mjs
75 lines (73 loc) · 1.58 KB
/
eslint.config.mjs
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
import callstackConfig from "@callstack/eslint-config/react.flat.js";
// false-positives below:
// eslint-disable-next-line import/no-unresolved
import cspellConfigs from "@cspell/eslint-plugin/configs";
// eslint-disable-next-line import/no-unresolved
import tsEslintParser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
/** @type {import('eslint').Linter.Config} */
export default [
{
ignores: [
"dist",
"coverage",
".nyc_output",
".github",
"docs",
"pages/dist-demos",
"pages/dist-e2e",
"src/util/typings.d.ts",
],
},
...callstackConfig,
cspellConfigs.recommended,
{
rules: {
"@cspell/spellchecker": [
"warn",
{
cspell: {
import: ["cspell.json"],
},
},
],
},
},
{
files: ["*.ts", "*.tsx", "*.d.ts"],
languageOptions: {
parser: tsEslintParser,
parserOptions: {
project: "./tsconfig.eslint.json",
},
},
},
eslintConfigPrettier,
eslintPluginPrettierRecommended,
{
rules: {
"import/order": "off", // handled by prettier & @trivago/prettier-plugin-sort-imports
"prettier/prettier": ["error"],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"**/tests/**/*.ts",
"**/tests/**/*.js",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.spec.ts",
"**/*.spec.tsx",
"*.config.js",
"*.config.mjs",
"*.config.ts",
"pages/**/*.ts",
"pages/**/*.js",
"scripts/**/*.ts",
],
},
],
},
},
];