forked from redhat-developer/vscode-extension-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
69 lines (67 loc) · 1.77 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// eslint.config.js
import { defineConfig } from 'eslint-define-config';
import ts from '@typescript-eslint/parser';
import tsEslint from '@typescript-eslint/eslint-plugin';
import stylisticEslint from '@stylistic/eslint-plugin';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default defineConfig([
{
ignores: ['**/*.test.js'],
},
eslintPluginPrettierRecommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: ts,
parserOptions: {
ecmaVersion: 2024,
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: {
impliedStrict: true,
},
},
globals: {
// declare global variables here
browser: 'readonly',
es2024: true,
mocha: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsEslint,
'@stylistic': stylisticEslint,
},
rules: {
'@typescript-eslint/no-var-requires': 'off', // allows require statements outside of imports
'@typescript-eslint/no-floating-promises': 'warn',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
caughtErrors: 'none', // ignore unused variables in catch blocks
},
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
],
'@stylistic/semi': 'warn',
curly: 'warn',
eqeqeq: ['warn', 'always'],
'no-redeclare': 'warn',
'no-throw-literal': 'warn',
'prettier/prettier': ['warn'],
},
},
]);