forked from streetsidesoftware/vscode-spell-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
113 lines (111 loc) · 3.67 KB
/
.eslintrc.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* @type { import("eslint").Linter.Config }
*/
const config = {
root: true,
reportUnusedDisableDirectives: true,
env: {
node: true,
jest: true,
es2020: true,
},
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:promise/recommended',
'plugin:prettier/recommended',
// 'plugin:unicorn/recommended',
],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
ignorePatterns: [
'**/*.d.ts',
'**/node_modules/**',
'packages/client/server/**',
'packages/*/dist/**',
'packages/*/out/**',
'**/temp/**',
'**/dist/**',
'packages/client/settingsViewer/**',
],
plugins: ['import', 'unicorn', 'simple-import-sort'],
rules: {
'node/no-unsupported-features/es-syntax': 'off',
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
quotes: ['warn', 'single', { avoidEscape: true }],
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'node/no-missing-import': [
'error',
{
allowModules: ['vscode'],
tryExtensions: ['.js', '.d.ts', '.ts'],
},
],
'node/no-unpublished-import': 'off',
'promise/catch-or-return': ['error', { terminationMethod: ['catch', 'finally'] }],
},
overrides: [
{
files: ['**/*.ts', '**/*.mts', '**/*.cts'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
// '@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
// '@typescript-eslint/no-non-null-assertion': 'off',
// '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
},
},
{
files: ['*.json'],
rules: {
quotes: ['error', 'double'],
},
},
{
files: ['**/*.js', '**/*.mjs'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
rules: {
'node/no-unsupported-features/es-syntax': 'off',
},
},
{
files: ['**/*.test.*', '**/__mocks__/**', '**/test/**', '**/test.*'],
rules: {
'node/no-extraneous-import': 'off',
},
},
{
files: ['vitest.config.*'],
rules: {
'node/no-extraneous-import': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['**/jest.config.js'],
rules: {
'node/no-unpublished-require': 'off',
},
},
],
settings: {
'import/core-modules': ['vscode'],
},
};
module.exports = config;