-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
54 lines (53 loc) · 1.84 KB
/
eslint.config.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
import esLint from "@eslint/js";
import esLintPrettier from "eslint-plugin-prettier/recommended";
import esLintSimpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tsEsLint from "typescript-eslint";
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts}"] },
// https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables
{ languageOptions: { globals: globals.browser } },
// https://typescript-eslint.io/getting-started
esLint.configs.recommended,
...tsEsLint.configs.recommended,
...tsEsLint.configs.strictTypeChecked,
...tsEsLint.configs.stylisticTypeChecked,
esLintPrettier,
{
plugins: {
// https://github.com/lydell/eslint-plugin-simple-import-sort
"simple-import-sort": esLintSimpleImportSort,
},
rules: {
indent: [
"error",
2,
{
SwitchCase: 1,
// https://stackoverflow.com/questions/52178093/ignore-the-indentation-in-a-template-literal-with-the-eslint-indent-rule
ignoredNodes: ["TemplateLiteral *"],
},
],
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"@typescript-eslint/no-unnecessary-type-parameters": "off",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["*.js"],
defaultProject: "./tsconfig.json",
},
},
},
},
];